diff options
| author | Daniel <daniel112092@gmail.com> | 2017-06-18 11:30:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-18 11:30:32 +0200 |
| commit | 80a56026b16d49a18fd3d42a2d3dfa06de167c82 (patch) | |
| tree | 8112db284de8e9240865e05577bd19c14ecc71f1 /src/main/java/gregtech/common | |
| parent | d7f24f3e68826adb1a15369628ded0744c123fca (diff) | |
| parent | 6f7e5063c0552c01dcc412ca01f0a243776dd9a1 (diff) | |
| download | GT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.tar.gz GT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.tar.bz2 GT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.zip | |
Merge pull request #26 from GTNewHorizons/reMerge
Re merge
Diffstat (limited to 'src/main/java/gregtech/common')
74 files changed, 620 insertions, 544 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index d26e899264..839dcd2367 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -81,7 +81,7 @@ public class GT_Client extends GT_Proxy private boolean isFirstClientPlayerTick; private String mMessage; public GT_Client() { - mCapeRenderer = new GT_CapeRenderer(mCapeList); + mCapeRenderer = new GT_CapeRenderer(mCapeList); mAnimationTick = 0L; mAnimationDirection = false; isFirstClientPlayerTick = true; @@ -231,7 +231,6 @@ public class GT_Client extends GT_Proxy String tName = arr$[i$]; mCapeList.add(tName.toLowerCase()); } - (new Thread(this)).start(); } @@ -256,9 +255,7 @@ public class GT_Client extends GT_Proxy GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); i++; } while (true); - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} // super.onPostLoad(); @@ -305,7 +302,7 @@ public class GT_Client extends GT_Proxy } } catch (Throwable e) { } - try { + /**try { GT_Log.out.println("GT_Mod: Downloading News."); @SuppressWarnings("resource") Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream()); @@ -313,7 +310,7 @@ public class GT_Client extends GT_Proxy this.mMessage = (this.mMessage + tScanner.nextLine() + " "); } } catch (Throwable e) { - } + }**/ } @SubscribeEvent diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 08afbbaf26..b6a2bb53e6 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -19,11 +19,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.net.GT_Packet_Pollution; -import gregtech.api.objects.GT_Fluid; -import gregtech.api.objects.GT_FluidStack; -import gregtech.api.objects.GT_UO_DimensionList; -import gregtech.api.objects.ItemData; -import gregtech.api.objects.MaterialStack; +import gregtech.api.objects.*; import gregtech.api.util.*; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.items.GT_MetaGenerated_Tool_01; @@ -59,6 +55,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; @@ -193,7 +190,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mCropNeedBlock = true; public boolean mReenableSimplifiedChemicalRecipes = false; public boolean mAMHInteraction = true; + public boolean mForceFreeFace = true; + public GT_Proxy() { GameRegistry.registerFuelHandler(this); MinecraftForge.EVENT_BUS.register(this); @@ -493,6 +492,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { break; } } + GT_LanguageManager.writePlaceholderStrings(); } public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE; @@ -802,7 +802,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.Ore.stackSize = 1; if (this.mIgnoreTcon || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) { if ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("xycraft")) || (aOriginalMod.toLowerCase(Locale.ENGLISH).contains("tconstruct")) - && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural"))) { + || ((aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natura")) && (!aOriginalMod.toLowerCase(Locale.ENGLISH).contains("natural")))) { if (GT_Values.D1) { GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P"); } @@ -1862,6 +1862,21 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { ////DO NOTHING - this chunk data was already loaded and stored in hash map //} } + + @SubscribeEvent + public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent) + { + if (aEvent.newSpeed > 0.0F) + { + if (aEvent.entityPlayer != null) + { + ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); + if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) { + aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent); + } + } + } + } public static class OreDictEventContainer { public final OreDictionary.OreRegisterEvent mEvent; diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 69c04e83f4..cdfc325569 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -128,15 +128,16 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){ - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { - return false; - } - if (aEUtick <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); - return true; - } + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { + return false; + } + if (aEUtick <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); + return true; + } + @Override public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, Fluid aPolymer){ //Oxygen/Rutile -> +50% Output each @@ -176,7 +177,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { new GT_Recipe(aInput1, aEUt, aInput2, aDuration, aOutput1, aOutput2); return true; } - + @Override public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false); @@ -295,8 +296,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } - - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { if ((aInput1 == null) || (aOutput1 == null)) { return false; @@ -382,10 +381,10 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return false; } int tExplosives = aInput2 > 0 ? aInput2 < 64 ? aInput2 : 64 : 1; - int tGunpowder = tExplosives * 2; - int tDynamite = tExplosives /2; - int tTNT = Math.max(1, tExplosives/2); - int tITNT = Math.max(1, tExplosives/4); + int tGunpowder = tExplosives<<1;//Worst + int tDynamite = Math.max(1, tExplosives>>1);//good + int tTNT = tExplosives;//Slightly better + int tITNT = Math.max(1, tExplosives>>2);//the best //new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2); if(tGunpowder<65){ GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, ItemList.Block_Powderbarrel.get(tGunpowder, new Object[0])}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 334097c729..6581e23637 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -138,7 +138,7 @@ public class GT_Worldgenerator //String tDimensionName = this.mWorld.provider.getDimensionName();
Random aRandom = new Random();
//if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) {
- if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) {
+ if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) {
short primaryMeta = 0;
short secondaryMeta = 0;
short betweenMeta = 0;
@@ -174,8 +174,8 @@ public class GT_Worldgenerator int tZ = mZ + aRandom.nextInt(16);
if (tDimensionType == 1) {
mSize = aRandom.nextInt((int) (endMaxSize - endMinSize));
- //} else if (tDimensionName.equals("Asteroids")) {
- // mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize));
+ //} else if (tDimensionName.equals("Asteroids")) {
+ // mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize));
}
if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) {
float var6 = aRandom.nextFloat() * 3.141593F;
@@ -218,14 +218,14 @@ public class GT_Worldgenerator GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false, true);
} else {
//if (tDimensionType == 1) {//TODO CHECK
- mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0);
+ mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0);
//} else if (tDimensionName.equals("Asteroids")) {
- ////int asteroidType = aRandom.nextInt(20);
- ////if (asteroidType == 19) { //Rare Asteroid?
- ////mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- ////} else {
- //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- ////}
+ ////int asteroidType = aRandom.nextInt(20);
+ ////if (asteroidT |
