aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
authorSphyix <masifede2@gmail.com>2021-11-21 12:59:39 +0100
committerSphyix <masifede2@gmail.com>2021-11-21 12:59:39 +0100
commit2901426a3fbaee614e245bc3d7f68dce9b1fd4a6 (patch)
tree5b7717983e0f53f94c1c67cb6d2186f452bb7e69 /src/main/java/gregtech/common
parent8b9f24202072698748cad0b5f6d0b6c9f9ce2a42 (diff)
parentabeecd2da02c7d38cb1c5b6e2fd5517c6f8a994b (diff)
downloadGT5-Unofficial-2901426a3fbaee614e245bc3d7f68dce9b1fd4a6.tar.gz
GT5-Unofficial-2901426a3fbaee614e245bc3d7f68dce9b1fd4a6.tar.bz2
GT5-Unofficial-2901426a3fbaee614e245bc3d7f68dce9b1fd4a6.zip
Merge branch 'experimental' of https://github.com/Sphyix/GT5-Unofficial into experimental
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_Client.java7
-rw-r--r--src/main/java/gregtech/common/GT_Network.java2
-rw-r--r--src/main/java/gregtech/common/GT_Pollution.java341
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java90
-rw-r--r--src/main/java/gregtech/common/GT_RecipeAdder.java71
-rw-r--r--src/main/java/gregtech/common/GT_UndergroundOil.java291
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Casings8.java18
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Machines.java36
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java18
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Item_Machines.java29
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Arm.java11
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java13
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java256
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java215
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java18
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java28
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java24
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java8
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java123
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java4
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Teleporter.java8
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java39
-rw-r--r--src/main/java/gregtech/common/items/GT_FluidDisplayItem.java67
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java311
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_98.java332
-rw-r--r--src/main/java/gregtech/common/misc/GT_Command.java2
-rw-r--r--src/main/java/gregtech/common/render/GT_CapeRenderer.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java29
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java13
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java97
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java21
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java206
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java63
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java131
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java28
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java89
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java45
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java49
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java50
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java14
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java28
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java14
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Axe.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java16
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_File.java4
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java10
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Hoe.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java11
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java10
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Plow.java6
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Plunger.java4
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Saw.java13
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Scoop.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Sense.java5
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Shovel.java11
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java4
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java6
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Sword.java17
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java24
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java8
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Wrench.java7
69 files changed, 2402 insertions, 1036 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java
index 55efd20920..b9701bb451 100644
--- a/src/main/java/gregtech/common/GT_Client.java
+++ b/src/main/java/gregtech/common/GT_Client.java
@@ -152,6 +152,7 @@ public class GT_Client extends GT_Proxy
private GT_ClientPreference mPreference;
private boolean mFirstTick = false;
public static final int ROTATION_MARKER_RESOLUTION = 120;
+ private int mReloadCount;
public GT_Client() {
mCapeRenderer = new GT_CapeRenderer(mCapeList);
@@ -505,6 +506,12 @@ public class GT_Client extends GT_Proxy
@SubscribeEvent
public void onClientConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent aEvent) {
mFirstTick = true;
+ mReloadCount++;
+ }
+
+ @Override
+ public int getReloadCount() {
+ return mReloadCount;
}
@SubscribeEvent
diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java
index c9c57676ad..97e511aba4 100644
--- a/src/main/java/gregtech/common/GT_Network.java
+++ b/src/main/java/gregtech/common/GT_Network.java
@@ -36,7 +36,7 @@ public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet>
public GT_Network() {
this.mChannel = NetworkRegistry.INSTANCE.newChannel("GregTech", this, new HandlerShared());
- this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores(), new GT_Packet_Pollution(), new MessageSetFlaskCapacity(), new GT_Packet_TileEntityCover(), new GT_Packet_TileEntityCoverGUI(), new MessageUpdateFluidDisplayItem(), new GT_Packet_ClientPreference(), new GT_Packet_WirelessRedstoneCover()};
+ this.mSubChannels = new GT_Packet[]{new GT_Packet_TileEntity(), new GT_Packet_Sound(), new GT_Packet_Block_Event(), new GT_Packet_Ores(), new GT_Packet_Pollution(), new MessageSetFlaskCapacity(), new GT_Packet_TileEntityCover(), new GT_Packet_TileEntityCoverGUI(), new MessageUpdateFluidDisplayItem(), new GT_Packet_ClientPreference(), new GT_Packet_WirelessRedstoneCover(), new GT_Packet_TileEntityCoverNew()};
}
@Override
diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java
index 7b1ad90d52..865fa83f7e 100644
--- a/src/main/java/gregtech/common/GT_Pollution.java
+++ b/src/main/java/gregtech/common/GT_Pollution.java
@@ -7,6 +7,7 @@ import gregtech.GT_Mod;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.net.GT_Packet_Pollution;
+import gregtech.api.util.GT_ChunkAssociatedData;
import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -20,30 +21,34 @@ import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
+import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.world.ChunkDataEvent;
import net.minecraftforge.event.world.ChunkWatchEvent;
+import net.minecraftforge.event.world.WorldEvent;
+import javax.annotation.ParametersAreNonnullByDefault;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-import static gregtech.common.GT_Proxy.GTPOLLUTION;
-import static gregtech.common.GT_Proxy.dimensionWiseChunkData;
import static gregtech.common.GT_Proxy.dimensionWisePollution;
-import static gregtech.common.GT_Proxy.getDefaultChunkDataOnCreation;
public class GT_Pollution {
+ private static final Storage STORAGE = new Storage();
/**
* Pollution dispersion until effects start:
* Calculation: ((Limit * 0.01) + 2000) * (4 <- spreading rate)
- *
+ * <p>
* SMOG(500k) 466.7 pollution/sec
* Poison(750k) 633,3 pollution/sec
* Dying Plants(1mio) 800 pollution/sec
* Sour Rain(1.5mio) 1133.3 pollution/sec
- *
+ * <p>
* Pollution producers (pollution/sec)
* Bronze Boiler(20)
* Lava Boiler(20)
@@ -52,7 +57,7 @@ public class GT_Pollution {
* Diesel Generator(40/80/160)
* Gas Turbine(20/40/80)
* Charcoal Pile(100)
- *
+ * <p>
* Large Diesel Engine(320)
* Electric Blast Furnace(100)
* Implosion Compressor(2000)
@@ -60,33 +65,27 @@ public class GT_Pollution {
* Large Gas Turbine(160)
* Multi Smelter(100)
* Pyrolyse Oven(400)
- *
+ * <p>
* Machine Explosion(100,000)
- *
+ * <p>
* Other Random Shit: lots and lots
- *
+ * <p>
* Muffler Hatch Pollution reduction: ** inaccurate **
* LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%)
*/
private List<ChunkCoordIntPair> pollutionList = new ArrayList<>();//chunks left to process
- private HashMap<ChunkCoordIntPair,int[]> chunkData;//link to chunk data that is saved/loaded
- private int operationsPerTick=0;//how much chunks should be processed in each cycle
- private static final short cycleLen=1200;
- private final World aWorld;
+ private final List<ChunkCoordIntPair> chunkData = new ArrayList<>();//link to chunk data that is saved/loaded
+ private int operationsPerTick = 0;//how much chunks should be processed in each cycle
+ private static final short cycleLen = 1200;
+ private final World world;
public static int mPlayerPollution;
private static int POLLUTIONPACKET_MINVALUE = 1000;
private static GT_PollutionEventHandler EVENT_HANDLER;
- public GT_Pollution(World world){
- aWorld=world;
- chunkData=dimensionWiseChunkData.get(aWorld.provider.dimensionId);
- if(chunkData==null){
- chunkData=new HashMap<>(1024);
- dimensionWiseChunkData.put(world.provider.dimensionId,chunkData);
- }
- dimensionWisePollution.put(aWorld.provider.dimensionId,this);
+ public GT_Pollution(World world) {
+ this.world = world;
if (EVENT_HANDLER == null) {
EVENT_HANDLER = new GT_PollutionEventHandler();
@@ -94,61 +93,61 @@ public class GT_Pollution {
}
}
- public static void onWorldTick(TickEvent.WorldTickEvent aEvent){//called from proxy
+ public static void onWorldTick(TickEvent.WorldTickEvent aEvent) {//called from proxy
//return if pollution disabled
- if(!GT_Mod.gregtechproxy.mPollution) return;
+ if (!GT_Mod.gregtechproxy.mPollution) return;
final GT_Pollution pollutionInstance = dimensionWisePollution.get(aEvent.world.provider.dimensionId);
- if(pollutionInstance==null)return;
- pollutionInstance.tickPollutionInWorld((int)(aEvent.world.getTotalWorldTime()%cycleLen));
+ if (pollutionInstance == null) return;
+ pollutionInstance.tickPollutionInWorld((int) (aEvent.world.getTotalWorldTime() % cycleLen));
}
- private void tickPollutionInWorld(int aTickID){//called from method above
+ private void tickPollutionInWorld(int aTickID) {//called from method above
//gen data set
- if(aTickID==0){
- pollutionList = new ArrayList<>(chunkData.keySet());
+ if (aTickID == 0) {
+ // make a snapshot of what to work on
+ // counterintuitive as it seems, but this is the fastest way java collections framework offers us.
+ pollutionList = new ArrayList<>(chunkData);
//set operations per tick
- if(pollutionList.size()>0) operationsPerTick =(pollutionList.size()/cycleLen);
- else operationsPerTick=0;//SANity
+ if (pollutionList.size() > 0) operationsPerTick = (pollutionList.size() / cycleLen);
+ else operationsPerTick = 0;//SANity
}
- for(int chunksProcessed=0;chunksProcessed<=operationsPerTick;chunksProcessed++){
- if(pollutionList.size()==0)break;//no more stuff to do
- ChunkCoordIntPair actualPos=pollutionList.remove(pollutionList.size()-1);//faster
- //add default data if missing
- if(!chunkData.containsKey(actualPos)) chunkData.put(actualPos,getDefaultChunkDataOnCreation());
+ for (int chunksProcessed = 0; chunksProcessed <= operationsPerTick; chunksProcessed++) {
+ if (pollutionList.size() == 0) break;//no more stuff to do
+ ChunkCoordIntPair actualPos = pollutionList.remove(pollutionList.size() - 1);//faster
//get pollution
- int tPollution = chunkData.get(actualPos)[GTPOLLUTION];
+ ChunkData currentData = STORAGE.get(world, actualPos);
+ int tPollution = currentData.getAmount();
//remove some
- tPollution = (int)(0.9945f*tPollution);
+ tPollution = (int) (0.9945f * tPollution);
//tPollution -= 2000;//This does not really matter...
- if(tPollution<=0) tPollution = 0;//SANity check
- else if(tPollution>400000){//Spread Pollution
+ if (tPollution <= 0) tPollution = 0;//SANity check
+ else if (tPollution > 400000) {//Spread Pollution
ChunkCoordIntPair[] tNeighbors = new ChunkCoordIntPair[4];//array is faster
- tNeighbors[0]=(new ChunkCoordIntPair(actualPos.chunkXPos+1,actualPos.chunkZPos));
- tNeighbors[1]=(new ChunkCoordIntPair(actualPos.chunkXPos-1,actualPos.chunkZPos));
- tNeighbors[2]=(new ChunkCoordIntPair(actualPos.chunkXPos,actualPos.chunkZPos+1));
- tNeighbors[3]=(new ChunkCoordIntPair(actualPos.chunkXPos,actualPos.chunkZPos-1));
- for(ChunkCoordIntPair neighborPosition : tNeighbors){
- if(!chunkData.containsKey(neighborPosition)) chunkData.put(neighborPosition,getDefaultChunkDataOnCreation());
-
- int neighborPollution = chunkData.get(neighborPosition)[GTPOLLUTION];
- if(neighborPollution*6 < tPollution*5){//METHEMATICS...
+ tNeighbors[0] = (new ChunkCoordIntPair(actualPos.chunkXPos + 1, actualPos.chunkZPos));
+ tNeighbors[1] = (new ChunkCoordIntPair(actualPos.chunkXPos - 1, actualPos.chunkZPos));
+ tNeighbors[2] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos + 1));
+ tNeighbors[3] = (new ChunkCoordIntPair(actualPos.chunkXPos, actualPos.chunkZPos - 1));
+ for (ChunkCoordIntPair neighborPosition : tNeighbors) {
+ ChunkData neighbor = STORAGE.get(world, neighborPosition);
+ int neighborPollution = neighbor.getAmount();
+ if (neighborPollution * 6 < tPollution * 5) {//MATHEMATICS...
int tDiff = tPollution - neighborPollution;
- tDiff = tDiff/20;
- neighborPollution = GT_Utility.safeInt((long)neighborPollution+tDiff);//tNPol += tDiff;
+ tDiff = tDiff / 20;
+ neighborPollution = GT_Utility.safeInt((long) neighborPollution + tDiff);//tNPol += tDiff;
tPollution -= tDiff;
- chunkData.get(neighborPosition)[GTPOLLUTION] = neighborPollution;
+ neighbor.setAmount(neighborPollution);
}
}
//Create Pollution effects
//Smog filter TODO
- if(tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit) {
+ if (tPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit) {
AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(actualPos.chunkXPos << 4, 0, actualPos.chunkZPos << 4, (actualPos.chunkXPos << 4) + 16, 256, (actualPos.chunkZPos << 4) + 16);
- List<EntityLivingBase> tEntitys = aWorld.getEntitiesWithinAABB(EntityLivingBase.class, chunk);
+ List<EntityLivingBase> tEntitys = world.getEntitiesWithinAABB(EntityLivingBase.class, chunk);
for (EntityLivingBase tEnt : tEntitys) {
if (tEnt instanceof EntityPlayerMP && ((EntityPlayerMP) tEnt).capabilities.isCreativeMode)
continue;
@@ -194,131 +193,211 @@ public class GT_Pollution {
int x = (actualPos.chunkXPos << 4) + XSTR_INSTANCE.nextInt(16);
int y = 60 + (-f + XSTR_INSTANCE.nextInt(f * 2 + 1));
int z = (actualPos.chunkZPos << 4) + XSTR_INSTANCE.nextInt(16);
- damageBlock(aWorld, x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit);
+ damageBlock(world, x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit);
}
}
}
}
}
//Write new pollution to Hashmap !!!
- chunkData.get(actualPos)[GTPOLLUTION] = tPollution;
+ currentData.setAmount(tPollution);
//Send new value to players nearby
if (tPollution > POLLUTIONPACKET_MINVALUE) {
- NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(aWorld.provider.dimensionId, (actualPos.chunkXPos << 4), 64, (actualPos.chunkZPos << 4), 256);
+ NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint(world.provider.dimensionId, (actualPos.chunkXPos << 4), 64, (actualPos.chunkZPos << 4), 256);
GT_Values.NW.sendToAllAround(new GT_Packet_Pollution(actualPos, tPollution), point);
}
}
}
- private static void damageBlock(World world, int x, int y, int z, boolean sourRain){
- if (world.isRemote) return;
+ private static void damageBlock(World world, int x, int y, int z, boolean sourRain) {
+ if (world.isRemote) return;
Block tBlock = world.getBlock(x, y, z);
int tMeta = world.getBlockMetadata(x, y, z);
- if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand|| tBlock == Blocks.deadbush)return;
-
- if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves)
- world.setBlockToAir(x, y, z);
- if (tBlock == Blocks.reeds) {
- tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
- world.setBlockToAir(x, y, z);
- }
- if (tBlock == Blocks.tallgrass)
- world.setBlock(x, y, z, Blocks.deadbush);
- if (tBlock == Blocks.vine) {
- tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
- world.setBlockToAir(x, y, z);
- }
- if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus ||
+ if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand || tBlock == Blocks.deadbush)
+ return;
+
+ if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves)
+ world.setBlockToAir(x, y, z);
+ if (tBlock == Blocks.reeds) {
+ tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
+ world.setBlockToAir(x, y, z);
+ }
+ if (tBlock == Blocks.tallgrass)
+ world.setBlock(x, y, z, Blocks.deadbush);
+ if (tBlock == Blocks.vine) {
+ tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
+ world.setBlockToAir(x, y, z);
+ }
+ if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus ||
tBlock.getMaterial() == Material.cactus || tBlock == Blocks.melon_block || tBlock == Blocks.melon_stem) {
- tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
- world.setBlockToAir(x, y, z);
- }
- if (tBlock == Blocks.red_flower || tBlock == Blocks.yellow_flower || tBlock == Blocks.carrots ||
+ tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0);
+ world.setBlockToAir(x, y, z);
+ }