mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
Little ones
- Fixed crash when simultaneously converting and destroying a Peculiar Bell (#2008) - Fixed Stockpile Switch not updating its signal when the inventory it's watching is moved (#1980) - Fixed Potato Cannon projectiles being able to move players in creative mode (#1950) - Fixed Lectern Controller not rendering buttons when being used by a different player
This commit is contained in:
parent
b6b6b32e96
commit
87d630ca0a
4 changed files with 25 additions and 19 deletions
|
@ -62,6 +62,9 @@ public class PeculiarBellBlock extends AbstractBellBlock<PeculiarBellTileEntity>
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BlockState tryConvert(IWorld world, BlockPos pos, BlockState state, BlockState underState) {
|
protected BlockState tryConvert(IWorld world, BlockPos pos, BlockState state, BlockState underState) {
|
||||||
|
if (!AllBlocks.PECULIAR_BELL.has(state))
|
||||||
|
return state;
|
||||||
|
|
||||||
Block underBlock = underState.getBlock();
|
Block underBlock = underState.getBlock();
|
||||||
if (!(Blocks.SOUL_FIRE.is(underBlock) || Blocks.SOUL_CAMPFIRE.is(underBlock)))
|
if (!(Blocks.SOUL_FIRE.is(underBlock) || Blocks.SOUL_CAMPFIRE.is(underBlock)))
|
||||||
return state;
|
return state;
|
||||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.util.IndirectEntityDamageSource;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
import net.minecraft.util.math.EntityRayTraceResult;
|
import net.minecraft.util.math.EntityRayTraceResult;
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||||
|
@ -222,7 +221,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
|
||||||
if (type.getReloadTicks() < 10)
|
if (type.getReloadTicks() < 10)
|
||||||
livingentity.invulnerableTime = type.getReloadTicks() + 10;
|
livingentity.invulnerableTime = type.getReloadTicks() + 10;
|
||||||
|
|
||||||
if (knockback > 0) {
|
if (onServer && knockback > 0) {
|
||||||
Vector3d appliedMotion = this.getDeltaMovement()
|
Vector3d appliedMotion = this.getDeltaMovement()
|
||||||
.multiply(1.0D, 0.0D, 1.0D)
|
.multiply(1.0D, 0.0D, 1.0D)
|
||||||
.normalize()
|
.normalize()
|
||||||
|
|
|
@ -8,12 +8,14 @@ import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBe
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour;
|
import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour;
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour.InterfaceProvider;
|
import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InvManipulationBehaviour.InterfaceProvider;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraft.world.ITickList;
|
||||||
import net.minecraft.world.TickPriority;
|
import net.minecraft.world.TickPriority;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
|
@ -75,8 +77,8 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, 0), 3);
|
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, 0), 3);
|
||||||
currentLevel = -1;
|
currentLevel = -1;
|
||||||
state = false;
|
state = false;
|
||||||
level.blockUpdated(worldPosition, getBlockState().getBlock());
|
|
||||||
sendData();
|
sendData();
|
||||||
|
scheduleBlockTick();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,13 +118,20 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
displayLevel = (int) (currentLevel * 6);
|
displayLevel = (int) (currentLevel * 6);
|
||||||
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, displayLevel), update ? 3 : 2);
|
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, displayLevel), update ? 3 : 2);
|
||||||
|
|
||||||
if (update && !level.getBlockTicks().willTickThisTick(worldPosition, getBlockState().getBlock()))
|
if (update)
|
||||||
level.getBlockTicks().scheduleTick(worldPosition, getBlockState().getBlock(), 2, TickPriority.NORMAL);
|
scheduleBlockTick();
|
||||||
|
|
||||||
if (changed || update)
|
if (changed || update)
|
||||||
sendData();
|
sendData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void scheduleBlockTick() {
|
||||||
|
ITickList<Block> blockTicks = level.getBlockTicks();
|
||||||
|
Block block = getBlockState().getBlock();
|
||||||
|
if (!blockTicks.willTickThisTick(worldPosition, block))
|
||||||
|
blockTicks.scheduleTick(worldPosition, block, 2, TickPriority.NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void lazyTick() {
|
public void lazyTick() {
|
||||||
super.lazyTick();
|
super.lazyTick();
|
||||||
|
|
|
@ -103,11 +103,6 @@ public class LinkedControllerItemRenderer extends CustomRenderedItemModelRendere
|
||||||
|
|
||||||
renderer.render(active ? model.getPartial("powered") : model.getOriginalModel(), light);
|
renderer.render(active ? model.getPartial("powered") : model.getOriginalModel(), light);
|
||||||
|
|
||||||
if (!usedByMe) {
|
|
||||||
ms.popPose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IBakedModel button = model.getPartial("button");
|
IBakedModel button = model.getPartial("button");
|
||||||
float s = 1 / 16f;
|
float s = 1 / 16f;
|
||||||
float b = s * -.75f;
|
float b = s * -.75f;
|
||||||
|
@ -120,28 +115,28 @@ public class LinkedControllerItemRenderer extends CustomRenderedItemModelRendere
|
||||||
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
msr.translate(2 * s, 0, 8 * s);
|
msr.translate(2 * s, 0, 8 * s);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
msr.translate(4 * s, 0, 0);
|
msr.translate(4 * s, 0, 0);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
msr.translate(-2 * s, 0, 2 * s);
|
msr.translate(-2 * s, 0, 2 * s);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
msr.translate(0, 0, -4 * s);
|
msr.translate(0, 0, -4 * s);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
|
|
||||||
msr.translate(3 * s, 0, 3 * s);
|
msr.translate(3 * s, 0, 3 * s);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
msr.translate(2 * s, 0, 0);
|
msr.translate(2 * s, 0, 0);
|
||||||
button(renderer, ms, light, pt, button, b, index++);
|
button(renderer, ms, light, pt, button, b, index++, usedByMe);
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void button(PartialItemModelRenderer renderer, MatrixStack ms, int light, float pt, IBakedModel button,
|
protected static void button(PartialItemModelRenderer renderer, MatrixStack ms, int light, float pt, IBakedModel button,
|
||||||
float b, int index) {
|
float b, int index, boolean usedByMe) {
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, b * buttons.get(index)
|
float depression = usedByMe ? b * buttons.get(index).getValue(pt) : 0;
|
||||||
.getValue(pt), 0);
|
ms.translate(0, depression, 0);
|
||||||
renderer.renderSolid(button, light);
|
renderer.renderSolid(button, light);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue