Skip to content

Commit

Permalink
fix + update
Browse files Browse the repository at this point in the history
Add a configuration file to the stacking limit
Fixed machine recipe issues caused by changes to the Mineral Dictionary (Close #87)
Fixed a crash caused by the lack of AT when holding a map when wearing mek armor
  • Loading branch information
sddsd2332 committed Nov 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent fa905d6 commit 8fb413b
Showing 11 changed files with 28 additions and 25 deletions.
2 changes: 2 additions & 0 deletions src/main/java/mekanism/common/config/MEKCEConfig.java
Original file line number Diff line number Diff line change
@@ -106,6 +106,8 @@ public class MEKCEConfig extends BaseConfig {
public final FloatOption LowEjectionThreshold = new FloatOption(this, "mekce", "LowEjectionThreshold", 0.5F, "Low ejection thresholds for gases and fluids, below which the MaximumEjectionDelay is waited for to be met before output", 0, 1);
public final FloatOption HighEjectionThreshold = new FloatOption(this, "mekce", "HighEjectionThreshold", 0.85F, "High ejection thresholds for gases and fluids, above which they are immediately output", 0, 1);
public final BooleanOption PlasticWrench = new BooleanOption(this,"mekce","PlasticWrench",false,"If true, allow the plastic to fall through the wrench");
public final BooleanOption StackingPlacementLimits = new BooleanOption(this,"mekce","StackingPlacementLimits",true,"If the number exceeds 1, it is forbidden to place blocks");

@Override
public void load(Configuration config) {
super.load(config);
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ public String getItemStackDisplayName(@Nonnull ItemStack itemstack) {
@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY,
float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() > 1) {
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, state);
2 changes: 1 addition & 1 deletion src/main/java/mekanism/common/item/ItemBlockGasTank.java
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ public String getItemStackDisplayName(@Nonnull ItemStack itemstack) {
@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY,
float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() > 1) {
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, state);
7 changes: 2 additions & 5 deletions src/main/java/mekanism/common/item/ItemBlockMachine.java
Original file line number Diff line number Diff line change
@@ -254,19 +254,16 @@ public void addInformation(@Nonnull ItemStack itemstack, World world, @Nonnull L
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, @Nonnull BlockPos pos, @Nonnull EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) {
ItemStack stack = player.getHeldItem(hand);
if (stack.getCount() > 1) {
return EnumActionResult.PASS;
}
MachineType type = MachineType.get(stack);
if (type == MachineType.FLUID_TANK && getBucketMode(stack)) {
if (type == MachineType.FLUID_TANK && getBucketMode(stack) && stack.getCount() > 1) {
return EnumActionResult.PASS;
}
return super.onItemUse(player, world, pos, hand, side, hitX, hitY, hitZ);
}

@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() > 1) {
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = true;
14 changes: 7 additions & 7 deletions src/main/java/mekanism/common/transmitters/TransmitterImpl.java
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ public Coord4D getAdjacentConnectableTransmitterCoord(EnumFacing side) {
return null;
}
if (CapabilityUtils.hasCapability(potentialTransmitterTile, Capabilities.GRID_TRANSMITTER_CAPABILITY, side.getOpposite())) {
IGridTransmitter transmitter = CapabilityUtils.getCapability(potentialTransmitterTile, Capabilities.GRID_TRANSMITTER_CAPABILITY, side.getOpposite());
IGridTransmitter<ACCEPTOR, NETWORK, BUFFER> transmitter = CapabilityUtils.getCapability(potentialTransmitterTile, Capabilities.GRID_TRANSMITTER_CAPABILITY, side.getOpposite());
if (TransmissionType.checkTransmissionType(transmitter, getTransmissionType()) && containingTile.isValidTransmitter(potentialTransmitterTile)) {
return sideCoord;
}
@@ -73,11 +73,11 @@ public ACCEPTOR getAcceptor(EnumFacing side) {

@Override
public boolean isValid() {
TileEntityTransmitter cont = getTileEntity();
if (cont == null) {
return false;
TileEntityTransmitter<ACCEPTOR, NETWORK, BUFFER> cont = getTileEntity();
if (cont != null) {
return !cont.isInvalid() && coord().exists(this.world()) && coord().getTileEntity(this.world()) == cont && cont.getTransmitter() == this;
}
return !cont.isInvalid() && coord().exists(world()) && coord().getTileEntity(world()) == cont && cont.getTransmitter() == this;
return false;
}

@Override
@@ -89,9 +89,9 @@ public NETWORK createEmptyNetwork() {
public NETWORK getExternalNetwork(Coord4D from) {
TileEntity tile = from.getTileEntity(world());
if (CapabilityUtils.hasCapability(tile, Capabilities.GRID_TRANSMITTER_CAPABILITY, null)) {
IGridTransmitter transmitter = CapabilityUtils.getCapability(tile, Capabilities.GRID_TRANSMITTER_CAPABILITY, null);
IGridTransmitter<ACCEPTOR, NETWORK, BUFFER> transmitter = CapabilityUtils.getCapability(tile, Capabilities.GRID_TRANSMITTER_CAPABILITY, null);
if (TransmissionType.checkTransmissionType(transmitter, getTransmissionType())) {
return ((IGridTransmitter<ACCEPTOR, NETWORK, BUFFER>) transmitter).getTransmitterNetwork();
return transmitter.getTransmitterNetwork();
}
}
return null;
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ public void addInformation(@Nonnull ItemStack itemstack, World world, @Nonnull L
@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY,
float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() >1){
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = true;
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ public void addInformation(@Nonnull ItemStack itemstack, World world, @Nonnull L
@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY,
float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() >1){
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = true;
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ public void addInformation(@Nonnull ItemStack itemstack, World world, @Nonnull L

@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull IBlockState state) {
if (stack.getCount() >1){
if (stack.getCount() > 1 && MekanismConfig.current().mekce.StackingPlacementLimits.val()) {
return false;
}
boolean place = true;
@@ -162,7 +162,7 @@ public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer play
}
}
}
}else if (type == MultiblockMachineType.DIGITAL_ASSEMBLY_TABLE){
} else if (type == MultiblockMachineType.DIGITAL_ASSEMBLY_TABLE) {
BlockPos.MutableBlockPos testPos = new BlockPos.MutableBlockPos();
for (int yPos = 0; yPos <= 4; yPos++) {
for (int xPos = -5; xPos <= 5; xPos++) {
@@ -274,7 +274,7 @@ public boolean hasTank(Object... data) {

@Override
public double getEnergy(ItemStack itemStack) {
if (itemStack.getCount() > 1){
if (itemStack.getCount() > 1) {
return 0;
}
if (!MultiblockMachineType.get(itemStack).isElectric) {
@@ -291,7 +291,7 @@ public void setEnergy(ItemStack itemStack, double amount) {
if (amount == 0) {
NBTTagCompound dataMap = ItemDataUtils.getDataMap(itemStack);
dataMap.removeTag("energyStored");
if (dataMap.isEmpty() && itemStack.getTagCompound()!=null) {
if (dataMap.isEmpty() && itemStack.getTagCompound() != null) {
itemStack.getTagCompound().removeTag(ItemDataUtils.DATA_ID);
}
} else {
@@ -307,7 +307,7 @@ public double getMaxEnergy(ItemStack itemStack) {

@Override
public double getMaxTransfer(ItemStack itemStack) {
if (itemStack.getCount() > 1){
if (itemStack.getCount() > 1) {
return 0;
}
return getMaxEnergy(itemStack) * 0.005;
@@ -326,7 +326,7 @@ public boolean canSend(ItemStack itemStack) {
@Override
@Optional.Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
public int receiveEnergy(ItemStack theItem, int energy, boolean simulate) {
if (theItem.getCount() > 1){
if (theItem.getCount() > 1) {
return 0;
}
if (canReceive(theItem)) {
@@ -343,7 +343,7 @@ public int receiveEnergy(ItemStack theItem, int energy, boolean simulate) {
@Override
@Optional.Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
public int extractEnergy(ItemStack theItem, int energy, boolean simulate) {
if (theItem.getCount() > 1){
if (theItem.getCount() > 1) {
return 0;
}
if (canSend(theItem)) {
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
},
"C": {"item": "#CIRCUITULTIMATE"},
"i": {
"ore": "AntimatterPellet",
"ore": "Antimatter",
"type": "forge:ore_dict"
},
"O": {
4 changes: 3 additions & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -23,7 +23,9 @@
"metallurgy",
"crafttweaker",
"cofhcore",
"cyclicmagic"
"cyclicmagic",
"draconicadditions@[1.12.2-1.17.0.45,)",
"draconicevolution@[1.12.2-2.3.28.193,)"
],
"requiredMods": [
"forge@[14.23.5.2768,)"
2 changes: 2 additions & 0 deletions src/main/resources/mekanism_at.cfg
Original file line number Diff line number Diff line change
@@ -30,3 +30,5 @@ public net.minecraft.potion.PotionEffect field_76460_b # duration
# EntityPlayer
public net.minecraft.entity.EntityLivingBase field_184632_c #HEALTH

public net.minecraft.client.renderer.ItemRenderer * # ALL THE FIELDS!!
public net.minecraft.client.renderer.ItemRenderer *() # ALL THE METHODS!!

0 comments on commit 8fb413b

Please sign in to comment.