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:
reidbhuntley 2021-07-24 17:08:50 -04:00
parent b6b6b32e96
commit 87d630ca0a
4 changed files with 25 additions and 19 deletions

View file

@ -62,6 +62,9 @@ public class PeculiarBellBlock extends AbstractBellBlock<PeculiarBellTileEntity>
}
protected BlockState tryConvert(IWorld world, BlockPos pos, BlockState state, BlockState underState) {
if (!AllBlocks.PECULIAR_BELL.has(state))
return state;
Block underBlock = underState.getBlock();
if (!(Blocks.SOUL_FIRE.is(underBlock) || Blocks.SOUL_CAMPFIRE.is(underBlock)))
return state;

View file

@ -31,7 +31,6 @@ import net.minecraft.util.IndirectEntityDamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
@ -222,7 +221,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
if (type.getReloadTicks() < 10)
livingentity.invulnerableTime = type.getReloadTicks() + 10;
if (knockback > 0) {
if (onServer && knockback > 0) {
Vector3d appliedMotion = this.getDeltaMovement()
.multiply(1.0D, 0.0D, 1.0D)
.normalize()

View file

@ -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.InterfaceProvider;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.ITickList;
import net.minecraft.world.TickPriority;
import net.minecraftforge.items.IItemHandler;
@ -75,8 +77,8 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, 0), 3);
currentLevel = -1;
state = false;
level.blockUpdated(worldPosition, getBlockState().getBlock());
sendData();
scheduleBlockTick();
return;
}
@ -116,13 +118,20 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
displayLevel = (int) (currentLevel * 6);
level.setBlock(worldPosition, getBlockState().setValue(StockpileSwitchBlock.INDICATOR, displayLevel), update ? 3 : 2);
if (update && !level.getBlockTicks().willTickThisTick(worldPosition, getBlockState().getBlock()))
level.getBlockTicks().scheduleTick(worldPosition, getBlockState().getBlock(), 2, TickPriority.NORMAL);
if (update)
scheduleBlockTick();
if (changed || update)
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
public void lazyTick() {
super.lazyTick();

View file

@ -103,11 +103,6 @@ public class LinkedControllerItemRenderer extends CustomRenderedItemModelRendere
renderer.render(active ? model.getPartial("powered") : model.getOriginalModel(), light);
if (!usedByMe) {
ms.popPose();
return;
}
IBakedModel button = model.getPartial("button");
float s = 1 / 16f;
float b = s * -.75f;
@ -120,28 +115,28 @@ public class LinkedControllerItemRenderer extends CustomRenderedItemModelRendere
ms.pushPose();
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);
button(renderer, ms, light, pt, button, b, index++);
button(renderer, ms, light, pt, button, b, index++, usedByMe);
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);
button(renderer, ms, light, pt, button, b, index++);
button(renderer, ms, light, pt, button, b, index++, usedByMe);
ms.popPose();
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);
button(renderer, ms, light, pt, button, b, index++);
button(renderer, ms, light, pt, button, b, index++, usedByMe);
ms.popPose();
}
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.translate(0, b * buttons.get(index)
.getValue(pt), 0);
float depression = usedByMe ? b * buttons.get(index).getValue(pt) : 0;
ms.translate(0, depression, 0);
renderer.renderSolid(button, light);
ms.popPose();
}