make the drill digging packet a config option that is off by default

This commit is contained in:
Ellpeck 2017-03-10 22:59:36 +01:00
parent a20116a9fd
commit 6e1c4df988
2 changed files with 7 additions and 3 deletions

View file

@ -49,7 +49,8 @@ public enum ConfigBoolValues{
LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"), LASER_RELAY_LOSS("Laser Relay Energy Loss", ConfigCategories.MACHINE_VALUES, true, "If Energy Laser Relays should have energy loss"),
SUPER_DUPER_HARD_MODE("Super Duper Hard Recipes", ConfigCategories.OTHER, false, "Turn this on to make recipes for items from the mod really hard. (This is a joke feature poking fun at the whole FTB Infinity Expert Mode style of playing. You shouldn't really turn this on as it makes the mod completely unplayable.)"); SUPER_DUPER_HARD_MODE("Super Duper Hard Recipes", ConfigCategories.OTHER, false, "Turn this on to make recipes for items from the mod really hard. (This is a joke feature poking fun at the whole FTB Infinity Expert Mode style of playing. You shouldn't really turn this on as it makes the mod completely unplayable.)"),
ENABLE_DRILL_DIGGING_PACKET("Drill Digging Packet", ConfigCategories.OTHER, false, "If this is set to true, breaking a block with the Drill will send an additional packet to the server notifying that the block is being broken. This reduces the amount of ghost blocks being created, however it results in a higher connection load and it could also change the behavior of some blocks being broken.");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.util;
import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver; import cofh.api.energy.IEnergyReceiver;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid; import net.minecraft.block.BlockLiquid;
@ -405,8 +406,10 @@ public final class WorldUtil{
player.setHeldItem(EnumHand.MAIN_HAND, null); player.setHeldItem(EnumHand.MAIN_HAND, null);
} }
if(ConfigBoolValues.ENABLE_DRILL_DIGGING_PACKET.isEnabled()){
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
mc.getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, mc.objectMouseOver.sideHit)); mc.getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, mc.objectMouseOver.sideHit));
}
return true; return true;
} }