Skip to content

Commit

Permalink
Version 1.3 - Hopefully fix server crash + update mcmod.info
Browse files Browse the repository at this point in the history
  • Loading branch information
Brittank88 committed Mar 27, 2024
1 parent ad91575 commit 60e3cdd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/main/java/com/brittank88/clipshot/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package com.brittank88.clipshot;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@SuppressWarnings("unused")
public class ClientProxy extends CommonProxy {

// Override CommonProxy methods here, if you want a different behaviour on the client (e.g. registering renders).
// Don't forget to call the super methods as well.

@Override
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
}
}
14 changes: 12 additions & 2 deletions src/main/java/com/brittank88/clipshot/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@

public class CommonProxy {

private boolean isClient = false;

// preInit "Run before anything else. Read your config, create blocks, items, etc., and register them with the
// GameRegistry." (Remove if not needed)
public void preInit(FMLPreInitializationEvent event) {

if (event.getSide()
.isServer())
// Skip initialisation on dedicated servers.
isClient = event.getSide()
.isClient();
if (!isClient) {
ClipShot.LOG.warn("ClipShot will do nothing on a dedicated server as it is a client-only mod!");
return;
}

// Initialise the configuration file.
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
Expand All @@ -28,6 +34,10 @@ public void preInit(FMLPreInitializationEvent event) {

// load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed)
public void init(@SuppressWarnings("unused") FMLInitializationEvent event) {

// Skip initialisation on dedicated servers.
if (isClient) return;

ClipShot.LOG.info("Getting system clipboard via AWT...");

try {
Expand Down
Binary file added src/main/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"modList": [{
"modid": "${modId}",
"name": "${modName}",
"description": "A Forge mod for Minecraft 1.7.10 which automatically copies screenshots to the clipboard.",
"description": "A Forge clientside mod for Minecraft 1.7.10 which automatically copies screenshots to the clipboard.",
"version": "${modVersion}",
"mcversion": "${minecraftVersion}",
"url": "https://github.com/Brittank88",
"url": "https://github.com/Brittank88/ClipShot",
"updateUrl": "",
"authorList": ["Brittank88"],
"credits": "",
"logoFile": "",
"credits": "Thanks to comp500 for the idea and the original code from ScreenshotToClipboard.",
"logoFile": "icon.png",
"screenshots": [],
"parent": "",
"requiredMods": [],
Expand Down

0 comments on commit 60e3cdd

Please sign in to comment.