diff options
author | Technus <daniel112092@gmail.com> | 2017-07-23 20:46:31 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2017-07-23 20:46:31 +0200 |
commit | 5fd8f681689686591b3bf6d4b84ab093ffe69077 (patch) | |
tree | 8fa1c98983252c4cdab8fd99c98f65d0cc8eddc0 | |
parent | 8ff87e5a4c306c80c44b4a18e20b44b3195b5f91 (diff) | |
parent | 5045ee4c216159fe23347d67f3cf27c420c9e1ca (diff) | |
download | GT5-Unofficial-5fd8f681689686591b3bf6d4b84ab093ffe69077.tar.gz GT5-Unofficial-5fd8f681689686591b3bf6d4b84ab093ffe69077.tar.bz2 GT5-Unofficial-5fd8f681689686591b3bf6d4b84ab093ffe69077.zip |
Merge branch 'master' of https://github.com/Technus/TecTech
11 files changed, 83 insertions, 36 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 0911642f18..0ff909faab 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.magicAddon.EssentiaCompat; import com.github.technus.tectech.magicAddon.EssentiaCompatEnabled; import com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat; @@ -14,9 +15,13 @@ import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import net.minecraft.client.audio.SoundManager; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.sound.SoundEvent; import java.util.List; @@ -26,9 +31,10 @@ import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaConta import static com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat.aspectDefinitionCompat; public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft to enable higher tier machinery. (above UV), or implement a check for GT tier values. + public static DamageSource microwaving; public void load() { - ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 4); + ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 5); progressBarLoad.step("Elemental Things"); new ElementalLoader().run(); @@ -50,6 +56,12 @@ public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft new MachineLoader().run(); TecTech.Logger.info("Machine Init Done"); + progressBarLoad.step("Add damage types"); + microwaving=new DamageSource("microwaving"); + microwaving.setDamageAllowedInCreativeMode(); + microwaving.setDamageBypassesArmor(); + TecTech.Logger.info("Damage types addition Done"); + ProgressManager.pop(progressBarLoad); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 9cd436cbfc..eebfd99b28 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -4,7 +4,6 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.GT_Container_CasingsTT; import com.github.technus.tectech.thing.metaTileEntity.iConstructible; -import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,7 +20,6 @@ import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT; -import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 76ae312df2..19b63ed604 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -1,10 +1,8 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.iConstructible; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -13,14 +11,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.FluidTankInfo; import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refMass; -import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refUnstableMass; import static com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition.stableRawLifeTime; import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT; -import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.VN; /** @@ -99,8 +93,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase m1 = input.getMass()/input.amount; cElementalInstanceStackMap decayed=input.decayCompute(input.getDefinition().getDecayArray(),1,0,0); m2 = decayed.getMass()/input.amount; - TecTech.Logger.info("I " + input.toString()); - TecTech.Logger.info("O " + decayed.toString()); + //TecTech.Logger.info("I " + input.toString()); + //TecTech.Logger.info("O " + decayed.toString()); return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index ba35db7a34..4a6f8a78fb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -1,30 +1,36 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.thing.metaTileEntity.iConstructible; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import java.util.HashSet; +import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.loader.MainLoader.microwaving; import static gregtech.api.GregTech_API.sBlockCasings4; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM { +public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { private int powerSetting = 1000; private int timerSetting = 0; private int timerValue = 0,timerValueBackup=0; @@ -78,6 +84,11 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override + public void construct(int qty) { + StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity()); + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.bassMark, @@ -102,30 +113,56 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void EM_outputFunction() { - timerValue=timerValueBackup--; + timerValue--; + timerValueBackup--; IGregTechTileEntity mte=getBaseMetaTileEntity(); int xDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetX*2; int zDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetZ*2; + int toMapTop=256-getBaseMetaTileEntity().getYCoord(); float xPos=mte.getXCoord()+0.5f; float yPos=mte.getYCoord()+0.5f; float zPos=mte.getZCoord()+0.5f; ArrayList<ItemStack> itemsToOutput=new ArrayList<>(); + HashSet<Entity> tickedStuff=new HashSet<>(); AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox(xPos-1.5+xDirShift,yPos-.5,zPos-1.5+zDirShift,xPos+1.5+xDirShift,yPos+2.5,zPos+1.5+zDirShift); - - for(Object entity : mte.getWorld().getEntitiesWithinAABBExcludingEntity(null,aabb)){ - if(entity instanceof Entity){ - if(entity instanceof EntityItem){ - itemsToOutput.add(((EntityItem) entity).getEntityItem()); - ((EntityItem) entity).setDead(); //todo FIX - //todo cook stuff with microwave recipes - }else if(entity instanceof EntityLiving){ - ((EntityLiving) entity).attackEntityFrom(DamageSource.inFire,powerSetting>>9);//todo add microwaving damage type - } - } + allAABB: + for(int i=0;i<=(toMapTop/3);i++) { + for (Object entity : mte.getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb)) { + float damagingFactor=powerSetting >> (9+i); + if(damagingFactor<=0) break allAABB; + if (entity instanceof Entity) { + if(tickedStuff.add((Entity)entity)) { + if (i == 0 && entity instanceof EntityItem) { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMicrowaveRecipes.findRecipe( + getBaseMetaTileEntity(), null, true, 128, null, null, new ItemStack[]{((EntityItem) entity).getEntityItem()}); + if (tRecipe == null || tRecipe.mInputs[0].stackSize != 1) { + itemsToOutput.add(((EntityItem) entity).getEntityItem()); + } else { + ItemStack newStuff = tRecipe.getOutput(0).copy(); + newStuff.stackSize = ((EntityItem) entity).getEntityItem().stackSize; + itemsToOutput.add(newStuff); + } + ((EntityItem) entity).setDead(); + } else if (entity instanceof EntityLiving) { + ((EntityLiving) entity).attackEntityFrom(microwaving, damagingFactor); + } else if (entity instanceof EntityPlayerMP) { + ((EntityPlayerMP) entity).attackEntityFrom(microwaving, damagingFactor); + } + } + } + } + aabb.offset(0,3,0); + aabb.minX-=.5f; + aabb.maxX+=.5f; + aabb.minY-=.5f; + aabb.maxY+=.5f; } mOutputItems=itemsToOutput.toArray(new ItemStack[0]); - if(timerValue==0) stopMachine(); + if(timerValue<=0 || timerValueBackup<=0) { + getBaseMetaTileEntity().getWorld().playSoundEffect(xPos,yPos,zPos, Reference.MODID+":microwave_ding", 1, 1); + stopMachine(); + } } @Override @@ -176,4 +213,10 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock timerValue = aNBT.getInteger("eTimerVal"); timerValueBackup = aNBT.getInteger("eTimerValBU"); } + + @Override + public void doExplosion(long aExplosionPower) { + super.doExplosion(aExplosionPower); + explodeMultiblock(); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/other todo b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/other todo index ba2a8d2062..3d87269020 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/other todo +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/other todo @@ -6,7 +6,6 @@ quark laseration quantum color separator antimatter weaponry tesla coils... -energizer starter manual book? design reader station - singleblock diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index bc9fae5daf..2ffacef383 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -1,12 +1,8 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPowerGenerator; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugStructureWriter; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPowerGenerator; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugStructureWriter; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -20,9 +16,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureWriter; -import static com.github.technus.tectech.Util.getUniqueIdentifier; - /** * Created by Tec on 23.03.2017. */ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 9ae3a6dfca..d5b61a7a05 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -19,7 +19,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureWriter; -import static com.github.technus.tectech.Util.getUniqueIdentifier; /** * Created by Tec on 23.03.2017. diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java index 89f50c0d7b..f799a7b56f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.single.gui; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPowerGenerator; -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugStructureWriter; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 691a8e5bff..6d76b761f7 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -2,3 +2,6 @@ itemGroup.TecTech=TecTech Interdimensional tile.quantumGlass.name=Quantum Glass item.em.debugContainer.name=Debug EM Container item.em.debugBuilder.name=Debug Builder + +death.attack.microwaving=%1$s was dehydrated by radiation. +death.attack.microwaving.player=%1$s was was dehydrated by radiation while fighting %2$s. diff --git a/src/main/resources/assets/tectech/sounds.json b/src/main/resources/assets/tectech/sounds.json new file mode 100644 index 0000000000..73c9e62808 --- /dev/null +++ b/src/main/resources/assets/tectech/sounds.json @@ -0,0 +1,7 @@ +{ + "microwave_ding": { + "category": "block", + "subtitle": "tectech.subtitle.microwave_ding", + "sounds": [{"name": "microwave_ding","stream": false}] + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/tectech/sounds/microwave_ding.ogg b/src/main/resources/assets/tectech/sounds/microwave_ding.ogg Binary files differnew file mode 100644 index 0000000000..489c3749d7 --- /dev/null +++ b/src/main/resources/assets/tectech/sounds/microwave_ding.ogg |