From e503dedb6e8f536da92235e61ae8739ef84f2e85 Mon Sep 17 00:00:00 2001 From: temp1011 Date: Tue, 22 May 2018 18:09:23 +0100 Subject: [PATCH 1/2] fix some (but not all) model loading errors --- build.gradle | 4 +- gradlew | 0 .../metalMultiblock_distillationTower.json | 2 +- .../blockstates/metal_device.json | 124 +++++++++++------- .../blockstates/metal_multiblock.json | 2 +- .../metal_multiblock_pumpjack.json | 2 +- 6 files changed, 78 insertions(+), 56 deletions(-) mode change 100644 => 100755 gradlew diff --git a/build.gradle b/build.gradle index 647505134..1f8237595 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ compileJava { } minecraft { - version = "14.23.1.2582" + version = "14.23.3.2655" runDir = "run" replace "@VERSION@", project.version @@ -31,7 +31,7 @@ minecraft { // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20170903" + mappings = "snapshot_20171003" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. useDepAts = true } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/resources/assets/immersivepetroleum/blockstates/metalMultiblock_distillationTower.json b/src/main/resources/assets/immersivepetroleum/blockstates/metalMultiblock_distillationTower.json index 601e64052..7fd0a14a9 100644 --- a/src/main/resources/assets/immersivepetroleum/blockstates/metalMultiblock_distillationTower.json +++ b/src/main/resources/assets/immersivepetroleum/blockstates/metalMultiblock_distillationTower.json @@ -3,7 +3,7 @@ "defaults": { "transform": "forge:default-block", - "model": "minecraft:cube-all", + "model": "minecraft:cube_all", "textures": { "all": "immersiveengineering:blocks/storage_steel" } diff --git a/src/main/resources/assets/immersivepetroleum/blockstates/metal_device.json b/src/main/resources/assets/immersivepetroleum/blockstates/metal_device.json index 43faab5a8..54fc2a107 100644 --- a/src/main/resources/assets/immersivepetroleum/blockstates/metal_device.json +++ b/src/main/resources/assets/immersivepetroleum/blockstates/metal_device.json @@ -1,53 +1,75 @@ { - "forge_marker": 1, - "defaults": - { - "transform": "forge:default-block", - "model": "immersiveengineering:ieSixSides", - "textures": { - "all": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side", - "particle": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side", - "particles": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side" - - } - }, - "variants": - { - "inventory,type=gas_generator": [{"model": "immersivepetroleum:generator"}], - "type": - { - "automatic_lubricator": { - }, - "gas_generator": { - "model": "immersivepetroleum:generator" - } - }, - "facing": - { - "down": { "transform": { - "rotation": {"x": -90 } - }}, - "up": { "transform": { - "rotation": {"x": 90 } - }}, - "east": { "transform": { - "rotation": {"y": 0 } - }}, - "west": { "transform": { - "rotation": {"y": 180 } - }}, - "north": { "transform": { - "rotation": {"y": 90 } - }}, - "south": { "transform": { - "rotation": {"y": -90 } - }} - }, - "_0multiblockslave": - { - "false":{}, - "true":{ - } - } - } + "forge_marker": 1, + "defaults": { + "transform": "forge:default-block", + "model": "immersiveengineering:ie_six_sides", + "textures": { + "all": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side", + "particle": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side", + "particles": "immersiveengineering:blocks/metal_device1_thermoelectric_gen_side" + } + }, + "variants": { + "inventory,type=gas_generator": [ + { + "model": "immersivepetroleum:generator" + } + ], + "type": { + "automatic_lubricator": { + }, + "gas_generator": { + "model": "immersivepetroleum:generator" + } + }, + "facing": { + "down": { + "transform": { + "rotation": { + "x": -90 + } + } + }, + "up": { + "transform": { + "rotation": { + "x": 90 + } + } + }, + "east": { + "transform": { + "rotation": { + "y": 0 + } + } + }, + "west": { + "transform": { + "rotation": { + "y": 180 + } + } + }, + "north": { + "transform": { + "rotation": { + "y": 90 + } + } + }, + "south": { + "transform": { + "rotation": { + "y": -90 + } + } + } + }, + "_0multiblockslave": { + "false": {}, + "true": { + } + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock.json b/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock.json index 7ff30aa26..c42405388 100644 --- a/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock.json +++ b/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock.json @@ -3,7 +3,7 @@ "defaults": { "transform": "forge:default-block", - "model": "minecraft:cube-all", + "model": "minecraft:cube_all", "textures": { "all": "immersiveengineering:blocks/storage_steel" } diff --git a/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock_pumpjack.json b/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock_pumpjack.json index 00d252016..07432a9f7 100644 --- a/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock_pumpjack.json +++ b/src/main/resources/assets/immersivepetroleum/blockstates/metal_multiblock_pumpjack.json @@ -3,7 +3,7 @@ "defaults": { "transform": "forge:default-block", - "model": "minecraft:cube-all", + "model": "minecraft:cube_all", "textures": { "all": "immersiveengineering:blocks/storage_steel" } From b5649d778662798714fc8ce618129fc4302f0046 Mon Sep 17 00:00:00 2001 From: temp1011 Date: Tue, 22 May 2018 18:52:00 +0100 Subject: [PATCH 2/2] update a couple of things --- build.gradle | 2 +- .../common/blocks/BlockIPBase.java | 2 +- .../blocks/BlockIPMetalMultiblocks.java | 2 +- .../common/entity/EntitySpeedboat.java | 116 +++++++++--------- .../gui/ContainerDistillationTower.java | 4 +- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/build.gradle b/build.gradle index 1f8237595..7fb858028 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ repositories { } dependencies { - deobfCompile "blusunrize:ImmersiveEngineering:0.12-79-+" + deobfCompile "blusunrize:ImmersiveEngineering:0.12-83-+" deobfCompile "mezz.jei:jei_1.12.2:4.8.5.133" deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.0.9.289" deobfCompile "elucent:albedo:2.0-SNAPSHOT" diff --git a/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPBase.java b/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPBase.java index 2e4ac58e5..8387aeda9 100644 --- a/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPBase.java +++ b/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPBase.java @@ -513,7 +513,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s entityIn.motionY=.05; return; } - if(entityIn.isCollidedHorizontally) + if(entityIn.collidedHorizontally) entityIn.motionY=.2; } } diff --git a/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPMetalMultiblocks.java b/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPMetalMultiblocks.java index 018f59e70..3548ba01d 100644 --- a/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPMetalMultiblocks.java +++ b/src/main/java/flaxbeard/immersivepetroleum/common/blocks/BlockIPMetalMultiblocks.java @@ -304,7 +304,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s entityIn.motionY=.05; return; } - if(entityIn.isCollidedHorizontally) + if(entityIn.collidedHorizontally) entityIn.motionY=.2; } } diff --git a/src/main/java/flaxbeard/immersivepetroleum/common/entity/EntitySpeedboat.java b/src/main/java/flaxbeard/immersivepetroleum/common/entity/EntitySpeedboat.java index 5864dd8cc..fec018184 100644 --- a/src/main/java/flaxbeard/immersivepetroleum/common/entity/EntitySpeedboat.java +++ b/src/main/java/flaxbeard/immersivepetroleum/common/entity/EntitySpeedboat.java @@ -47,7 +47,7 @@ public class EntitySpeedboat extends EntityBoat private static final DataParameter[] DATA_ID_PADDLE = new DataParameter[] {EntityDataManager.createKey(EntityBoat.class, DataSerializers.BOOLEAN), EntityDataManager.createKey(EntityBoat.class, DataSerializers.BOOLEAN)}; private static final DataParameter TANK_FLUID = EntityDataManager.createKey(EntitySpeedboat.class, DataSerializers.STRING); private static final DataParameter TANK_AMOUNT = EntityDataManager.createKey(EntitySpeedboat.class, DataSerializers.VARINT); - + private static final DataParameter UPGRADE_0 = EntityDataManager.createKey(EntitySpeedboat.class, DataSerializers.ITEM_STACK); private static final DataParameter UPGRADE_1 = EntityDataManager.createKey(EntitySpeedboat.class, DataSerializers.ITEM_STACK); private static final DataParameter UPGRADE_2 = EntityDataManager.createKey(EntitySpeedboat.class, DataSerializers.ITEM_STACK); @@ -80,9 +80,9 @@ public class EntitySpeedboat extends EntityBoat private double lastYd; private float lastMoving; public float propellerRotation = 0F; - + public boolean inLava = false; - + public EntitySpeedboat(World worldIn) { super(worldIn); @@ -180,7 +180,7 @@ else if (!this.world.isRemote && !this.isDead) this.setForwardDirection(-this.getForwardDirection()); this.setTimeSinceHit(10); this.setDamageTaken(this.getDamageTaken() + amount * 10.0F); - this.setBeenAttacked(); + this.markVelocityChanged(); boolean flag = source.getImmediateSource() instanceof EntityPlayer && ((EntityPlayer)source.getImmediateSource()).capabilities.isCreativeMode; boolean flag2 = source.getImmediateSource() instanceof EntityPlayer; if (flag || (this.getDamageTaken() > 40.0F && (!this.isFireproof || flag2)) || (this.getDamageTaken() > 240.0F)) @@ -212,15 +212,15 @@ else if (!this.world.isRemote && !this.isDead) return true; } } - + public void readTank(NBTTagCompound nbt) { FluidTank tank = new FluidTank(getMaxFuel()); - if (nbt != null) + if (nbt != null) tank.readFromNBT(nbt.getCompoundTag("tank")); setContainedFluid(tank.getFluid()); } - + public void writeTank(NBTTagCompound nbt, boolean toItem) { FluidTank tank = new FluidTank(getMaxFuel()); @@ -284,7 +284,7 @@ public EnumFacing getAdjustedHorizontalFacing() { return this.getHorizontalFacing().rotateY(); } - + public static DataParameter getFlags() { return FLAGS; @@ -357,7 +357,7 @@ public void onUpdate() this.motionY = 0.0D; this.motionZ = 0.0D; } - + if (this.world.isRemote) { if (!isEmergency()) @@ -369,7 +369,7 @@ public void onUpdate() } ImmersivePetroleum.proxy.handleEntitySound(IESounds.dieselGenerator, this, this.isBeingRidden() && this.getContainedFluid() != null && this.getContainedFluid().amount > 0, this.forwardInputDown || this.backInputDown ? .5f : .3f, moving); lastMoving = moving; - + if (this.forwardInputDown && this.world.rand.nextInt(2) == 0) { if (inLava) @@ -429,16 +429,16 @@ else if (this.getPaddleState(1)) } } } - + // - - - + + + float xO = (float) (MathHelper.sin(-this.rotationYaw * 0.017453292F)); float zO = (float) (MathHelper.cos(this.rotationYaw * 0.017453292F)); Vector2f vec = new Vector2f(xO, zO); vec.normalize(); - + if (hasIcebreaker && !isEmergency()) { AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().grow(0.1f); @@ -456,12 +456,12 @@ else if (this.getPaddleState(1)) { blockpos$pooledmutableblockpos2.setPos(i, j, k); IBlockState iblockstate = this.world.getBlockState(blockpos$pooledmutableblockpos2); - + Vector2f vec2 = new Vector2f((float) (i + 0.5f - posX), (float) (k + 0.5f - posZ)); vec2.normalize(); - + float sim = vec2.dot(vec); - + if (iblockstate.getBlock() == Blocks.ICE && sim > .3f) { this.world.destroyBlock(blockpos$pooledmutableblockpos2, false); @@ -477,7 +477,7 @@ else if (this.getPaddleState(1)) blockpos$pooledmutableblockpos2.release(); } - + // this.doBlockCollisions(); @@ -500,17 +500,17 @@ else if (this.getPaddleState(1)) else { this.applyEntityCollision(entity); - + if (hasIcebreaker) { if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer) && this.getControllingPassenger() instanceof EntityPlayer) { - + Vector2f vec2 = new Vector2f((float) (entity.posX - posX), (float) (entity.posZ - posZ)); vec2.normalize(); - + float sim = vec2.dot(vec); - + if (sim > .5f) { entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) this.getControllingPassenger()), 4); @@ -556,7 +556,7 @@ public float getRowingTime(int p_184448_1_, float limbSwing) { return this.getPaddleState(p_184448_1_) ? (float)MathHelper.clampedLerp((double)this.paddlePositions[p_184448_1_] - 0.01D, (double)this.paddlePositions[p_184448_1_], (double)limbSwing) : 0.0F; } - + if (this.getPaddleState(0)) { return (float)MathHelper.clampedLerp((double)this.paddlePositions[p_184448_1_] - (isBoosting ? 0.02D : 0.01D), (double)this.paddlePositions[p_184448_1_], (double)limbSwing); @@ -863,7 +863,7 @@ else if (this.status == EntityBoat.Status.ON_LAND) this.boatGlide /= 2.0F; } } - + this.motionX *= (double)this.momentum; this.motionZ *= (double)this.momentum; @@ -879,7 +879,7 @@ else if (this.status == EntityBoat.Status.ON_LAND) } } } - + public boolean isEmergency() { FluidStack fluid = this.getContainedFluid(); @@ -894,7 +894,7 @@ public boolean isEmergency() return hasPaddles; } } - + private void controlBoat() { if (this.isBeingRidden()) @@ -937,9 +937,9 @@ private void controlBoat() else { - + this.rotationYaw += this.deltaRotation; - + FluidStack fluid = this.getContainedFluid(); int consumeAmount = 0; if (fluid != null) @@ -958,7 +958,7 @@ private void controlBoat() toConsume *= 3; } } - + if (this.backInputDown) { f -= 0.005F * 2F; @@ -966,20 +966,20 @@ private void controlBoat() fluid.amount = Math.max(0, fluid.amount - toConsume); this.setContainedFluid(fluid); IPPacketHandler.INSTANCE.sendToServer(new ConsumeBoatFuelPacket(toConsume)); - + this.setPaddleState(this.forwardInputDown, this.backInputDown); - + } else { this.setPaddleState(false, false); } - + this.motionX += (double)(MathHelper.sin(-this.rotationYaw * 0.017453292F) * f); this.motionZ += (double)(MathHelper.cos(this.rotationYaw * 0.017453292F) * f); - + float speed = (float) Math.sqrt(motionX * motionX + motionZ * motionZ); - + if (this.leftInputDown) { this.deltaRotation += -1.1F * speed * (hasRudders ? 1.5F : 1F) * (isBoosting ? 0.5F : 1) * (backInputDown && !forwardInputDown ? 2F : 1F); @@ -988,7 +988,7 @@ private void controlBoat() propellerRotation -= 0.2F; } } - + if (this.rightInputDown) { this.deltaRotation += 1.1F * speed * (hasRudders ? 1.5F : 1F) *(isBoosting ? 0.5F : 1) * (backInputDown && !forwardInputDown ? 2F : 1F); @@ -997,13 +997,13 @@ private void controlBoat() propellerRotation += 0.2F; } } - + if (!this.rightInputDown && !this.leftInputDown) { propellerRotation *= 0.7F; } - - + + } } } @@ -1013,7 +1013,7 @@ public void updatePassenger(Entity passenger) { if (this.isPassenger(passenger)) { - + float f = 0.0F; float f1 = (float)((this.isDead ? 0.009999999776482582D : this.getMountedYOffset()) + passenger.getYOffset()); @@ -1086,7 +1086,7 @@ protected void writeEntityToNBT(NBTTagCompound compound) compound.setString("tank_fluid", fs == null ? "" : fs.getFluid().getName()); compound.setInteger("tank_amount", fs == null ? 0 : fs.amount); NBTTagList list = new NBTTagList(); - + NonNullList upgrades = getUpgrades(); for (int i = 0; i < upgrades.size(); i++) { @@ -1108,14 +1108,14 @@ protected void readEntityFromNBT(NBTTagCompound compound) { this.setBoatType(EntityBoat.Type.getTypeFromString(compound.getString("Type"))); } - + String fluidName = compound.getString("tank_fluid"); Fluid f = FluidRegistry.getFluid(fluidName); int amount = compound.getInteger("tank_amount"); setContainedFluid(f == null ? null : new FluidStack(f, amount)); - + NBTTagList list = (NBTTagList) compound.getTag("upgrades"); - + NonNullList upgrades = NonNullList.withSize(4, ItemStack.EMPTY); for (int i = 0; i < list.tagCount(); i++) { @@ -1147,7 +1147,7 @@ public int fill(FluidStack resource, boolean doFill) setContainedFluid(tank.getFluid()); return true; } - + if (!this.world.isRemote && !player.isSneaking() && this.outOfControlTicks < 60.0F && !player.isRidingOrBeingRiddenBy(this)) { player.startRiding(this); @@ -1241,33 +1241,33 @@ public String[] getOverlayText(EntityPlayer player, RayTraceResult mop) else s = I18n.format(Lib.GUI + "empty"); return new String[] {s}; - + } return null; } - + protected boolean isFluidValid(FluidStack resource) { return resource != null && resource.getFluid() != null && FuelHandler.isValidBoatFuel(resource.getFluid()); } - + public int getMaxFuel() { return hasTank ? 16000 : 8000; } - + public FluidStack getContainedFluid() { String fluidName = ((String) this.dataManager.get(TANK_FLUID)); Fluid f = FluidRegistry.getFluid(fluidName); if (f == null) return null; - + int amount = (Integer) this.dataManager.get(TANK_AMOUNT); if (amount == 0) return null; - + return new FluidStack(f, amount); } - + public void setContainedFluid(FluidStack stack) { if (stack == null) @@ -1282,12 +1282,12 @@ public void setContainedFluid(FluidStack stack) } } - + public boolean canRiderInteract() { return true; } - + public NonNullList getUpgrades() { NonNullList stackList = NonNullList.withSize(4, ItemStack.EMPTY); @@ -1301,7 +1301,7 @@ public NonNullList getUpgrades() stackList.set(3, o3); return stackList; } - + public void setUpgrades(NonNullList nonNullList) { if (nonNullList != null && nonNullList.size() >= 4) @@ -1317,8 +1317,8 @@ public void setUpgrades(NonNullList nonNullList) } } - - + + @Override public void notifyDataManagerChange(DataParameter key) { @@ -1358,7 +1358,7 @@ else if (upgrade.getItem() == IPContent.itemUpgrades && upgrade.getItemDamage() } super.notifyDataManagerChange(key); } - + public boolean isFireproof = false; public boolean hasIcebreaker = false; public boolean hasTank = false; diff --git a/src/main/java/flaxbeard/immersivepetroleum/common/gui/ContainerDistillationTower.java b/src/main/java/flaxbeard/immersivepetroleum/common/gui/ContainerDistillationTower.java index d4edf7949..50ccdbffc 100644 --- a/src/main/java/flaxbeard/immersivepetroleum/common/gui/ContainerDistillationTower.java +++ b/src/main/java/flaxbeard/immersivepetroleum/common/gui/ContainerDistillationTower.java @@ -20,7 +20,7 @@ public ContainerDistillationTower(InventoryPlayer inventoryPlayer, TileEntityDis super(inventoryPlayer, tile); final TileEntityDistillationTower tileF = tile; - this.addSlotToContainer(new IESlot.FluidContainer(this, this.inv, 0, 12,17, false) + this.addSlotToContainer(new IESlot.FluidContainer(this, this.inv, 0, 12,17, 1) { @Override public boolean isItemValid(ItemStack itemStack) @@ -41,7 +41,7 @@ public boolean isItemValid(ItemStack itemStack) }); this.addSlotToContainer(new IESlot.Output(this, this.inv, 1, 12,53)); - this.addSlotToContainer(new IESlot.FluidContainer(this, this.inv, 2, 134,17, true) + this.addSlotToContainer(new IESlot.FluidContainer(this, this.inv, 2, 134,17, 0) { @Override public boolean isItemValid(ItemStack itemStack)