diff --git a/conf/build.gradle.forge b/conf/build.gradle.forge new file mode 100644 index 0000000..5c80cc3 --- /dev/null +++ b/conf/build.gradle.forge @@ -0,0 +1,126 @@ +apply plugin: 'java' +apply plugin: 'eclipse' + +sourceCompatibility = '1.6' +targetCompatibility = '1.6' + +repositories +{ + maven + { + name 'forge' + url 'http://files.minecraftforge.net/maven' + } + mavenCentral() + maven + { + name 'sonatypeSnapshot' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + maven + { + name 'minecraft' + url 'https://libraries.minecraft.net/' + } +} + +dependencies +{ + compile 'net.minecraft:launchwrapper:1.9' + compile 'org.ow2.asm:asm-debug-all:4.1' + compile 'org.scala-lang:scala-library:2.10.2' + compile 'org.scala-lang:scala-compiler:2.10.2' + compile 'net.sf.jopt-simple:jopt-simple:4.5' + compile 'lzma:lzma:0.0.1' + compile 'com.mojang:realms:1.2.4' + compile 'org.apache.commons:commons-compress:1.8.1' + compile 'org.apache.httpcomponents:httpclient:4.3.3' + compile 'commons-logging:commons-logging:1.1.3' + compile 'org.apache.httpcomponents:httpcore:4.3.2' + compile 'java3d:vecmath:1.3.1' + compile 'net.sf.trove4j:trove4j:3.0.3' + compile 'com.ibm.icu:icu4j-core-mojang:51.2' + compile 'com.paulscode:codecjorbis:20101023' + compile 'com.paulscode:codecwav:20101023' + compile 'com.paulscode:libraryjavasound:20101123' + compile 'com.paulscode:librarylwjglopenal:20100824' + compile 'com.paulscode:soundsystem:20120107' + compile 'io.netty:netty-all:4.0.10.Final' + compile 'com.google.guava:guava:16.0' + compile 'org.apache.commons:commons-lang3:3.2.1' + compile 'commons-io:commons-io:2.4' + compile 'commons-codec:commons-codec:1.9' + compile 'net.java.jinput:jinput:2.0.5' + compile 'net.java.jutils:jutils:1.0.0' + compile 'com.google.code.gson:gson:2.2.4' + compile 'com.mojang:authlib:1.5.13' + compile 'org.apache.logging.log4j:log4j-api:2.0-beta9' + compile 'org.apache.logging.log4j:log4j-core:2.0-beta9' + compile 'org.lwjgl.lwjgl:lwjgl:2.9.1' + compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.1' + compile 'tv.twitch:twitch:5.16' + + testCompile 'junit:junit:4.5' +} + +sourceSets +{ + main + { + java + { + srcDir 'src/main/java/' + srcDir '/var/lib/jenkins/workspace/froge_update/src/main/java/' + } + resources + { + srcDir 'src/main/resources/' + srcDir '/var/lib/jenkins/workspace/froge_update/src/main/resources/' + } + } + test + { + java + { + srcDir '/var/lib/jenkins/workspace/froge_update/src/test/java/' + } + resources + { + srcDir '/var/lib/jenkins/workspace/froge_update/src/test/resources/' + } + } +} +def links = [] +def dupes = [] +eclipse.project.file.withXml { provider -> + def node = provider.asNode() + links = [] + dupes = [] + node.linkedResources.link.each { child -> + def path = child.location.text() + if (path in dupes) { + child.replaceNode {} + } else { + dupes.add(path) + def newName = path.split('/')[-2..-1].join('/') + links += newName + child.replaceNode { + link{ + name(newName) + type('2') + location(path) + } + } + } + } +} + +eclipse.classpath.file.withXml { + def node = it.asNode() + node.classpathentry.each { child -> + if (child.@kind == 'src' && !child.@path.contains('/')) child.replaceNode {} + if (child.@path in links) links.remove(child.@path) + } + links.each { link -> node.appendNode('classpathentry', [kind:'src', path:link]) } +} +tasks.eclipseClasspath.dependsOn 'eclipseProject' //Make them run in correct order diff --git a/src/main/java/cpw/mods/fml/relauncher/Side.java b/src/main/java/cpw/mods/fml/relauncher/Side.java index 4b2b159..0f1a21e 100644 --- a/src/main/java/cpw/mods/fml/relauncher/Side.java +++ b/src/main/java/cpw/mods/fml/relauncher/Side.java @@ -1,15 +1,41 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + package cpw.mods.fml.relauncher; -public enum Side -{ +public enum Side { + + /** + * The client side. Specifically, an environment where rendering capability exists. + * Usually in the game client. + */ CLIENT, + /** + * The server side. Specifically, an environment where NO rendering capability exists. + * Usually on the dedicated server. + */ SERVER; + /** + * @return If this is the server environment + */ public boolean isServer() { - return !this.isClient(); + return !isClient(); } + /** + * @return if this is the Client environment + */ public boolean isClient() { return this == CLIENT; diff --git a/src/main/java/cpw/mods/fml/relauncher/SideOnly.java b/src/main/java/cpw/mods/fml/relauncher/SideOnly.java index 3e21461..cb8a185 100644 --- a/src/main/java/cpw/mods/fml/relauncher/SideOnly.java +++ b/src/main/java/cpw/mods/fml/relauncher/SideOnly.java @@ -1,3 +1,15 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + package cpw.mods.fml.relauncher; import java.lang.annotation.ElementType; @@ -5,9 +17,25 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import cpw.mods.fml.common.SidedProxy; + + +/** + * Marks the associated element as being only available on a certain {@link Side}. This is + * generally meant for internal Forge and FML use only and should only be used on mod classes + * when other more common mechanisms, such as using a {@link SidedProxy} fail to work. + * + * Note, this will only apply to the direct element marked. This code: + * @SideOnly public MyField field = new MyField(); will not work, as the initializer + * is a separate piece of code to the actual field declaration, and will not be able to find + * it's field on the wrong side. + * + * @author cpw + * + */ @Retention(RetentionPolicy.RUNTIME) -@Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) public @interface SideOnly { - Side value(); + public Side value(); } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java b/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java index 2652fdf..6684692 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -914,6 +914,7 @@ GL11.glDisable(GL11.GL_LIGHTING); GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. + GL11.glEnable(GL11.GL_BLEND); //Forge: Make sure blend is enabled else tabs show a white border. this.drawTexturedModalRect(l, i1, j, k, 28, b0); this.zLevel = 100.0F; itemRender.zLevel = 100.0F; diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java index b59c1c6..8e675a8 100644 --- a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -1829,7 +1829,7 @@ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.fogColorRed, this.fogColorGreen, this.fogColorBlue); MinecraftForge.EVENT_BUS.post(event); - + this.fogColorRed = event.red; this.fogColorBlue = event.blue; this.fogColorGreen = event.green; @@ -1869,13 +1869,13 @@ Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entitylivingbase, p_78468_2_); float f1; - net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, 0.1F, p_78468_2_); + net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, p_78468_2_, 0.1F); - if (MinecraftForge.EVENT_BUS.post(event)) + if (MinecraftForge.EVENT_BUS.post(event)) { GL11.glFogf(GL11.GL_FOG_DENSITY, event.density); } - else + else if (entitylivingbase.isPotionActive(Potion.blindness)) { f1 = 5.0F; diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java index b9d6bca..888adea 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java @@ -785,7 +785,7 @@ private static RenderItem instance; /** - * Returns a single lazy loaded instance of RenderItem, for use in mods who + * Returns a single lazy loaded instance of RenderItem, for use in mods who * don't care about the interaction of other objects on the current state of the RenderItem they are using. * @return A global instance of RenderItem */ diff --git a/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java b/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java index 824fe7a..dfe13ec 100644 --- a/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +++ b/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java @@ -176,6 +176,9 @@ GL11.glTranslatef(0.16F, -0.16F, 0.0F); } + net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this); + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + { if (item == Items.filled_map) { this.renderManager.renderEngine.bindTexture(mapBackgroundTextures); @@ -244,6 +247,7 @@ } } } + } GL11.glPopMatrix(); } diff --git a/src/main/java/net/minecraft/server/management/ItemInWorldManager.java b/src/main/java/net/minecraft/server/management/ItemInWorldManager.java index 1dc31fc..68d6ce5 100644 --- a/src/main/java/net/minecraft/server/management/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/management/ItemInWorldManager.java @@ -157,13 +157,13 @@ float f = 1.0F; Block block = this.theWorld.getBlock(p_73074_1_, p_73074_2_, p_73074_3_); - + if (!block.isAir(theWorld, p_73074_1_, p_73074_2_, p_73074_3_)) { if (event.useBlock != Event.Result.DENY) { block.onBlockClicked(theWorld, p_73074_1_, p_73074_2_, p_73074_3_, thisPlayerMP); - theWorld.extinguishFire(thisPlayerMP, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + theWorld.extinguishFire(null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); } else { diff --git a/src/main/java/net/minecraft/world/WorldType.java b/src/main/java/net/minecraft/world/WorldType.java index c8af9f5..682f194 100644 --- a/src/main/java/net/minecraft/world/WorldType.java +++ b/src/main/java/net/minecraft/world/WorldType.java @@ -217,7 +217,7 @@ { this(getNextID(), name); } - + /** * Called when 'Create New World' button is pressed before starting game */ @@ -230,7 +230,7 @@ */ public int getSpawnFuzz() { - return 20; + return net.minecraftforge.common.ForgeModContainer.defaultSpawnFuzz; } /** @@ -255,7 +255,7 @@ { return this == FLAT; } - + /** * Get the height to render the clouds for this world type @@ -268,7 +268,7 @@ /** * Creates the GenLayerBiome used for generating the world - * + * * @param worldSeed The world seed * @param parentLayer The parent layer to feed into any layer you return * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 5302991..37b63a3 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -69,7 +69,7 @@ public class ForgeHooksClient { //private static final ResourceLocation ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - + static TextureManager engine() { return FMLClientHandler.instance().getClient().renderEngine; @@ -319,6 +319,12 @@ { ImageIO.setUseCache(false); //Disable on-disc stream cache should speed up texture pack reloading. PixelFormat format = new PixelFormat().withDepthBits(24); + if (!ForgeModContainer.enableStencilBits) + { + Display.create(format); + stencilBits = 0; + return; + } try { //TODO: Figure out how to determine the max bits. @@ -369,7 +375,7 @@ private static boolean skyInit; private static int skyRGBMultiplier; - + public static int getSkyBlendColour(World world, int playerX, int playerY, int playerZ) { if (playerX == skyX && playerZ == skyZ && skyInit) @@ -385,7 +391,7 @@ { distance = ranges[settings.renderDistanceChunks]; } - + int r = 0; int g = 0; int b = 0; diff --git a/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java new file mode 100644 index 0000000..0ec1689 --- /dev/null +++ b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java @@ -0,0 +1,27 @@ +package net.minecraftforge.client.event; + +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * This event is called when an item is rendered in an item frame. + * + * You can set canceled to do no further vanilla processing. + */ +@Cancelable +public class RenderItemInFrameEvent extends Event +{ + public final ItemStack item; + public final EntityItemFrame entityItemFrame; + public final RenderItemFrame renderer; + + public RenderItemInFrameEvent(EntityItemFrame itemFrame, RenderItemFrame renderItemFrame) + { + item = itemFrame.getDisplayedItem(); + entityItemFrame = itemFrame; + renderer = renderItemFrame; + } +} diff --git a/src/main/java/net/minecraftforge/common/ForgeModContainer.java b/src/main/java/net/minecraftforge/common/ForgeModContainer.java index 3b3b89a..601053b 100644 --- a/src/main/java/net/minecraftforge/common/ForgeModContainer.java +++ b/src/main/java/net/minecraftforge/common/ForgeModContainer.java @@ -66,7 +66,9 @@ public static float zombieBabyChance = 0.05f; public static boolean shouldSortRecipies = true; public static boolean disableVersionCheck = false; - + public static boolean enableStencilBits = true; + public static int defaultSpawnFuzz = 20; + private static Configuration config; public ForgeModContainer() @@ -89,7 +91,7 @@ config = null; File cfgFile = new File(Loader.instance().getConfigDir(), "forge.cfg"); config = new Configuration(cfgFile); - + syncConfig(true); } @@ -98,7 +100,7 @@ { return "net.minecraftforge.client.gui.ForgeGuiFactory"; } - + public static Configuration getConfig() { return config; @@ -112,7 +114,7 @@ // By adding a property order list we are defining the order that the properties will appear both in the config file and on the GUIs. // Property order lists are defined per-ConfigCategory. List propOrder = new ArrayList(); - + if (!config.isChild) { if (load) @@ -125,7 +127,7 @@ Configuration.enableGlobalConfig(); } } - + Property prop; prop = config.get(CATEGORY_GENERAL, "disableVersionCheck", false); @@ -137,8 +139,8 @@ prop.setLanguageKey("forge.configgui.disableVersionCheck"); disableVersionCheck = prop.getBoolean(disableVersionCheck); propOrder.add(prop.getName()); - - prop = config.get(Configuration.CATEGORY_GENERAL, "clumpingThreshold", 64, + + prop = config.get(Configuration.CATEGORY_GENERAL, "clumpingThreshold", 64, "Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024", 64, 1024); prop.setLanguageKey("forge.configgui.clumpingThreshold").setRequiresWorldRestart(true); clumpingThreshold = prop.getInt(64); @@ -204,18 +206,31 @@ blendRanges = prop.getIntList(); propOrder.add(prop.getName()); - prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBaseSummonChance", 0.1, + prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBaseSummonChance", 0.1, "Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic.", 0.0D, 1.0D); prop.setLanguageKey("forge.configgui.zombieBaseSummonChance").setRequiresWorldRestart(true); zombieSummonBaseChance = prop.getDouble(0.1); propOrder.add(prop.getName()); - prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBabyChance", 0.05, + prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBabyChance", 0.05, "Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic.", 0.0D, 1.0D); prop.setLanguageKey("forge.configgui.zombieBabyChance").setRequiresWorldRestart(true); zombieBabyChance = (float) prop.getDouble(0.05); propOrder.add(prop.getName()); - + + prop = config.get(Configuration.CATEGORY_GENERAL, "enableStencilBits", true); + prop.comment = "Set to false to attempt to allocate 8 stencil bits when starting the GL display context."; + prop.setLanguageKey("forge.configgui.stencilbits").setRequiresWorldRestart(true); + enableStencilBits = prop.getBoolean(true); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "defaultSpawnFuzz", 20, + "The spawn fuzz when a player respawns in the world, this is controlable by WorldType, this config option is for the default overworld.", + 1, Integer.MAX_VALUE); + prop.setLanguageKey("forge.configgui.spawnfuzz").setRequiresWorldRestart(false); + defaultSpawnFuzz = prop.getInt(20); + propOrder.add(prop.getName()); + config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder); if (config.hasChanged()) @@ -223,7 +238,7 @@ config.save(); } } - + /** * By subscribing to the OnConfigChangedEvent we are able to execute code when our config screens are closed. * This implementation uses the optional configID string to handle multiple Configurations using one event handler. diff --git a/src/main/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java b/src/main/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java index eb962d2..7572ec0 100644 --- a/src/main/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java +++ b/src/main/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java @@ -34,7 +34,7 @@ public void callStage2(QueuedChunk queuedChunk, net.minecraft.world.chunk.Chunk chunk) throws RuntimeException { if(chunk == null) { // If the chunk loading failed just do it synchronously (may generate) - queuedChunk.provider.loadChunk(queuedChunk.x, queuedChunk.z); + queuedChunk.provider.originalLoadChunk(queuedChunk.x, queuedChunk.z); return; } diff --git a/src/main/resources/assets/forge/lang/en_US.lang b/src/main/resources/assets/forge/lang/en_US.lang index 3d2e685..25759ef 100644 --- a/src/main/resources/assets/forge/lang/en_US.lang +++ b/src/main/resources/assets/forge/lang/en_US.lang @@ -40,6 +40,8 @@ forge.configgui.zombieBabyChance=Zombie Baby Chance forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. forge.configgui.modID=Mod ID diff --git a/src/main/resources/fmlversion.properties b/src/main/resources/fmlversion.properties index f027986..68b16c7 100644 --- a/src/main/resources/fmlversion.properties +++ b/src/main/resources/fmlversion.properties @@ -1,6 +1,6 @@ fmlbuild.major.number=7 fmlbuild.minor.number=10 fmlbuild.revision.number=1 -fmlbuild.build.number=41 +fmlbuild.build.number=49 fmlbuild.mcversion=1.7.10 fmlbuild.mcpversion=9.05 diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index 59064b1..482e65a 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,28 +1,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +