Compare commits

...
3 changed files with 14 additions and 18 deletions

No files matched your search

+2 -2
View File
@@ -3,9 +3,9 @@ name: Build and test
on:
pull_request:
branches: [ master, main ]
branches: [ master, main, release/** ]
push:
branches: [ master, main ]
branches: [ master, main, release/** ]
jobs:
build-and-test:
@@ -91,16 +91,11 @@ public class ItemCertusQuartzTank extends BaseItemBlockContainer implements IFlu
if (!container.stackTagCompound.hasKey("tileEntity")
|| container.stackTagCompound.getCompoundTag("tileEntity").hasKey("Empty")) {
NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound());
if (this.capacity < resource.amount) {
fluidTag.setInteger("Amount", this.capacity);
int finalAmount = Math.min(resource.amount, this.capacity);
NBTTagCompound fluidTag = new FluidStack(resource.getFluid(), finalAmount, resource.tag)
.writeToNBT(new NBTTagCompound());
container.stackTagCompound.setTag("tileEntity", fluidTag);
return this.capacity;
}
container.stackTagCompound.setTag("tileEntity", fluidTag);
return resource.amount;
return finalAmount;
}
NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("tileEntity");
@@ -59,8 +59,9 @@ public class WirelessMagnet {
// This method uses the same algorithm as the magnet from draconic evolution
// if changes are ever made, they should be made on both
public static void doMagnet(ItemStack wirelessTerm, EntityPlayer player) {
if (player.ticksExisted % 5 != 0 || player.isSneaking() || !isConfigured(wirelessTerm)) return;
World world = player.worldObj;
final World world = player.worldObj;
if (world.isRemote || player.ticksExisted % 5 != 0 || player.isSneaking() || !isConfigured(wirelessTerm))
return;
final List<EntityItem> items = getEntitiesInRange(
EntityItem.class,
world,
@@ -70,9 +71,7 @@ public class WirelessMagnet {
magnetRange);
final boolean skipPlayerCheck = world.playerEntities.size() < 2;
boolean playSound = false;
// account for the server/client desync
double playerEyesPos = player.posY
+ (world.isRemote ? player.getEyeHeight() - player.getDefaultEyeHeight() : player.getEyeHeight());
double playerEyesPos = player.posY + player.getEyeHeight();
for (EntityItem itemToGet : items) {
if (itemToGet.getEntityItem() == null || itemToGet instanceof EntityFloatingItem) {
@@ -95,6 +94,10 @@ public class WirelessMagnet {
player.posX - 0.2 + (world.rand.nextDouble() * 0.4),
playerEyesPos - 0.62,
player.posZ - 0.2 + (world.rand.nextDouble() * 0.4));
// EntityTracker only syncs item positions every 20 ticks and skips small velocity changes,
// so force both; otherwise the client keeps simulating the item with its old motion.
itemToGet.isAirBorne = true; // force position update
itemToGet.velocityChanged = true; // force velocity update
}
if (playSound) {
@@ -105,7 +108,6 @@ public class WirelessMagnet {
0.5F * ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 2F));
}
if (!world.isRemote) {
// xp
final List<EntityXPOrb> xpOrbs = getEntitiesInRange(
EntityXPOrb.class,
@@ -134,7 +136,6 @@ public class WirelessMagnet {
}
}
}
}
public static Mode getMode(ItemStack is) {
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {