Skip to content

Commit

Permalink
Formatted *everything* to the "official" codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize committed Jul 8, 2018
1 parent c658529 commit e3e8cf6
Show file tree
Hide file tree
Showing 563 changed files with 12,833 additions and 9,923 deletions.
14 changes: 9 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#### Issues
### General
### Pull requests
When wanting to contribute code to IE, please make sure to follow its inherent style of formatting.
A matching xml file for use with IntelliJ's codestyle feature can be found [here](https://gist.github.com/BluSunrize/5c05af8f29de9581426551d9b29b1809).

### Issues
#### General
- Make sure to use to the latest version of Immersive Engineering (IE for short). You can download it [here](http://minecraft.curseforge.com/projects/immersive-engineering).
- IE will create a file for its coremod in your `mods` folder. This is a `.jar` file called `ImmersiveEngineering-0.12-x-core.jar` before IE build 81 and Forge build 2656 and a directory called `memory-repo` afterwards. This is normal and not something to worry about. It's Forge convention to place coremods in separate files. The file is not downloaded, it is shipped with IE and automatically unpacked by Forge.
- Your bug report should contain answers to these questions (If adding screenshots makes answering one of these questions easier, add them):
Expand All @@ -9,12 +13,12 @@
- Did this happen on a dedicated server (multiplayer servers), in LAN multiplayer or in singleplayer? E.g. "I first noticed this on a server, but it happens in singleplayer as well".
- What other mods were installed when the bug happened? Crashlogs always contain a modlist, so you can skip this part if you already provided one. You can generate a crash and therefore a mod list by pressing and holding F3 and C for 10 seconds, then releasing. Example: "This happened when playing version 2.4.2 of the FTB Infinity modpack" or "A list of mods can be found here: `<link to pastebin/gist/...>`" or "Only IE was installed when this happened".

### Crashlogs
#### Crashlogs
If your Minecraft instance has crashed, a file will have been generated in the folder `crash-reports` of your minecraft folder. To understand what has happened, we need to know the content of that file. But please don't just put it directly in your report (that makes it hard to read), upload it to a site like [pastebin](http://pastebin.com) or [gist](http://gist.github.com) and put a link in the actuall bug report.

There is one case where no crash log will be generated: If it wasn't MC that crashed but Java. There will be a file called `hs_err` and then some number in your minecraft folder. If that happens, make sure your Java version is up to date (But not Java 9, Minecraft isn't compatible with it). Also make sure that Minecraft is actually using that version, the vanilla launcher includes an old Java version (Java 8 update 25, published in autumn 2014). You can see what version Minecraft is using in the top right of the debug screen (F3). There is a known JVM crash that happens at random while browsing the engineer's manual but only with the old Java version.

### Other mods
#### Other mods
Some mods are not officially supported by IE. They will probably work pretty well, but some thing might not work/look weird. If your modpack contains one or more of these mods and you encounter a bug, try removing the unsupported mods. If the bug/crash does not happen without those mods, don't report it since fixing interactions with those mods is usually impossible or extremely hard. The following mods are not officially supported:

- **Optifine**: Optifine changes a lot of Minecraft's rendering code and it is not legally possible to check what those changes are. Another problem is that there is no `dev`/`deobf` version of Optifine which makes running Optifine in a development environment pretty much impossible.
Expand All @@ -25,7 +29,7 @@ Some mods are not officially supported by IE. They will probably work pretty wel

- **Torcherino** and other mods to speed up machines (not crops): If they cause a crash, report it. If they don't work on IE machines or cause rendering glitches, don't report it.

### Known issues
#### Known issues
It is not unlikely that the issue you want to report has already been reported and maybe it has even been fixed for the next version of IE. Try searching for different terms related to your issue [here](https://github.com/Blusunrize/ImmersiveEngineering/issues?utf8=%E2%9C%93&q=is%3Aissue+). You can enter search terms in the box above the list of issues. Please <b>always</b> search for both open and closed issues as issues are closed when the fix has been written, not when a release containing a fix is published. If your issue has already been reported, please do <b>not</b> post comments like "I have the same crash: &lt;link to crashlog&gt;" unless someone specifically asks for additional crashlogs to help track down the issue.

Example: Assume you experienced the crash described in [#1549](https://github.com/BluSunrize/ImmersiveEngineering/issues/1549). Some possible search terms are ["crash crafting wire cutter"](https://github.com/BluSunrize/ImmersiveEngineering/issues?utf8=%E2%9C%93&q=is%3Aissue%20crash%20crafting%20wire%20cutter%20), ["crafting crash"](https://github.com/BluSunrize/ImmersiveEngineering/issues?utf8=%E2%9C%93&q=is%3Aissue%20crafting%20crash) and ["voltmeter crash"](https://github.com/BluSunrize/ImmersiveEngineering/issues?utf8=%E2%9C%93&q=is%3Aissue%20voltmeter%20crash).
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ImmersiveEngineering

@Mod.Instance(MODID)
public static ImmersiveEngineering instance = new ImmersiveEngineering();
@SidedProxy(clientSide="blusunrize.immersiveengineering.client.ClientProxy", serverSide="blusunrize.immersiveengineering.common.CommonProxy")
@SidedProxy(clientSide = "blusunrize.immersiveengineering.client.ClientProxy", serverSide = "blusunrize.immersiveengineering.common.CommonProxy")
public static CommonProxy proxy;

public static final SimpleNetworkWrapper packetHandler = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
Expand All @@ -83,20 +83,21 @@ public void preInit(FMLPreInitializationEvent event)
for(int b : IEConfig.Ores.oreDimBlacklist)
IEWorldGen.oreDimBlacklist.add(b);
IEApi.modPreference = Arrays.asList(IEConfig.preferredOres);
IEApi.prefixToIngotMap.put("ingot", new Integer[]{1,1});
IEApi.prefixToIngotMap.put("nugget", new Integer[]{1,9});
IEApi.prefixToIngotMap.put("block", new Integer[]{9,1});
IEApi.prefixToIngotMap.put("plate", new Integer[]{1,1});
IEApi.prefixToIngotMap.put("wire", new Integer[]{1,1});
IEApi.prefixToIngotMap.put("gear", new Integer[]{4,1});
IEApi.prefixToIngotMap.put("rod", new Integer[]{2,1});
IEApi.prefixToIngotMap.put("fence", new Integer[]{5,3});
IEApi.prefixToIngotMap.put("ingot", new Integer[]{1, 1});
IEApi.prefixToIngotMap.put("nugget", new Integer[]{1, 9});
IEApi.prefixToIngotMap.put("block", new Integer[]{9, 1});
IEApi.prefixToIngotMap.put("plate", new Integer[]{1, 1});
IEApi.prefixToIngotMap.put("wire", new Integer[]{1, 1});
IEApi.prefixToIngotMap.put("gear", new Integer[]{4, 1});
IEApi.prefixToIngotMap.put("rod", new Integer[]{2, 1});
IEApi.prefixToIngotMap.put("fence", new Integer[]{5, 3});
IECompatModule.doModulesPreInit();

new ThreadContributorSpecialsDownloader();

IEContent.preInitEnd();
}

@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
Expand Down Expand Up @@ -138,6 +139,7 @@ public void init(FMLInitializationEvent event)
IEIMCHandler.init();
IEIMCHandler.handleIMCMessages(FMLInterModComms.fetchRuntimeMessages(instance));
}

@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
Expand All @@ -148,11 +150,13 @@ public void postInit(FMLPostInitializationEvent event)
proxy.postInitEnd();
ShaderRegistry.compileWeight();
}

@Mod.EventHandler
public void loadComplete(FMLLoadCompleteEvent event)
{
IECompatModule.doModulesLoadComplete();
}

@Mod.EventHandler
public void modIDMapping(FMLModIdMappingEvent event)
{
Expand All @@ -167,17 +171,16 @@ public void modIDMapping(FMLModIdMappingEvent event)
public void wrongSignature(FMLFingerprintViolationEvent event)
{
System.out.println("[Immersive Engineering/Error] THIS IS NOT AN OFFICIAL BUILD OF IMMERSIVE ENGINEERING! Found these fingerprints: "+event.getFingerprints());
for (String altCert:alternativeCerts)
if (event.getFingerprints().contains(altCert))
for(String altCert : alternativeCerts)
if(event.getFingerprints().contains(altCert))
{
System.out.println("[Immersive Engineering/Error] "+altCert+" is considered an alternative certificate (which may be ok to use in some cases). " +
System.out.println("[Immersive Engineering/Error] "+altCert+" is considered an alternative certificate (which may be ok to use in some cases). "+
"If you thought this was an official build you probably shouldn't use it.");
break;
}
}



@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
Expand All @@ -186,20 +189,21 @@ public void serverStarting(FMLServerStartingEvent event)
if(IEConfig.Machines.arcfurnace_recycle)
ArcRecyclingThreadHandler.doRecipeProfiling();
}

@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
if(FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
{
World world = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld();
if(!world.isRemote)
{
IELogger.info("WorldData loading");

//Clear out any info from previous worlds
for (int dim: ImmersiveNetHandler.INSTANCE.getRelevantDimensions())
for(int dim : ImmersiveNetHandler.INSTANCE.getRelevantDimensions())
ImmersiveNetHandler.INSTANCE.clearAllConnections(dim);
IESaveData worldData = (IESaveData) world.loadData(IESaveData.class, IESaveData.dataName);
IESaveData worldData = (IESaveData)world.loadData(IESaveData.class, IESaveData.dataName);

if(worldData==null)
{
Expand Down Expand Up @@ -255,10 +259,11 @@ public ItemStack getTabIconItem()
{
return ItemStack.EMPTY;
}

@Override
public ItemStack getIconItemStack()
{
return new ItemStack(IEContent.blockMetalDecoration0,1,0);
return new ItemStack(IEContent.blockMetalDecoration0, 1, 0);
}
};

Expand All @@ -278,28 +283,31 @@ public ThreadContributorSpecialsDownloader()
public void run()
{
Gson gson = new Gson();
try {
try
{
IELogger.info("Attempting to download special revolvers from GitHub");
URL url = new URL("https://raw.githubusercontent.com/BluSunrize/ImmersiveEngineering/master/contributorRevolvers.json");
JsonStreamParser parser = new JsonStreamParser(new InputStreamReader(url.openStream()));
while(parser.hasNext())
{
try{
try
{
JsonElement je = parser.next();
ItemRevolver.SpecialRevolver revolver = gson.fromJson(je, ItemRevolver.SpecialRevolver.class);
if(revolver!=null)
{
if(revolver.uuid!=null)
for(String uuid : revolver.uuid)
ItemRevolver.specialRevolvers.put(uuid, revolver);
ItemRevolver.specialRevolversByTag.put(!revolver.tag.isEmpty()?revolver.tag:revolver.flavour, revolver);
ItemRevolver.specialRevolversByTag.put(!revolver.tag.isEmpty()?revolver.tag: revolver.flavour, revolver);
}
}catch(Exception excepParse)
} catch(Exception excepParse)
{
IELogger.warn("Error on parsing a SpecialRevolver");
}
}
} catch(Exception e) {
} catch(Exception e)
{
IELogger.info("Could not load contributor+special revolver list.");
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@

/**
* @author BluSunrize - 24.09.2015
*
* <p>
* Just an AABB with additional info, for use with pipes
*/
public class AdvancedAABB extends AxisAlignedBB
{
public EnumFacing fd;
public Vec3d[][] drawOverride;

public AdvancedAABB(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax, EnumFacing fd, Vec3d[]... drawOverride)
{
super(xMin, yMin, zMin, xMax, yMax, zMax);
this.fd = fd;
this.drawOverride = drawOverride;
}

public AdvancedAABB(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax, EnumFacing fd)
{
this(xMin, yMin, zMin, xMax, yMax, zMax, fd, new Vec3d[0][]);
}

public AdvancedAABB(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax, Vec3d[]... drawOverride)
{
this(xMin, yMin, zMin, xMax, yMax, zMax, null, drawOverride);
}

public AdvancedAABB(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax)
{
this(xMin, yMin, zMin, xMax, yMax, zMax, null, new Vec3d[0][]);
Expand Down
Loading

0 comments on commit e3e8cf6

Please sign in to comment.