use of com.simibubi.create.content.contraptions.components.flywheel.engine.EngineBlock in project SteamPowered by TeamMoegMC.
the class MixinFlywheel method sp$tick.
@Inject(at = @At("HEAD"), method = "tick")
public void sp$tick(CallbackInfo cbi) {
Direction at = FlywheelBlock.getConnection(getBlockState());
if (at != null) {
BlockPos eng = this.getBlockPos().relative(at, 2);
Block b = this.getWorld().getBlockState(eng).getBlock();
if (!(b instanceof EngineBlock)) {
FlywheelBlock.setConnection(getWorld(), getBlockPos(), getBlockState(), null);
this.setRotation(0, 0);
} else {
TileEntity te = this.getWorld().getBlockEntity(eng);
if (te instanceof EngineTileEntity) {
if (te instanceof SteamEngineTileEntity) {
SteamEngineTileEntity ete = (SteamEngineTileEntity) te;
if (ete.getFlywheel() != this.getBlockState().getBlock())
this.setRotation(0, 0);
}
} else
this.setRotation(0, 0);
}
} else
this.setRotation(0, 0);
}
use of com.simibubi.create.content.contraptions.components.flywheel.engine.EngineBlock in project Create by Creators-of-Create.
the class ClientEvents method addToItemTooltip.
@SubscribeEvent
public static void addToItemTooltip(ItemTooltipEvent event) {
if (!AllConfigs.CLIENT.tooltips.get())
return;
if (event.getPlayer() == null)
return;
ItemStack stack = event.getItemStack();
String translationKey = stack.getItem().getDescriptionId(stack);
if (translationKey.startsWith(ITEM_PREFIX) || translationKey.startsWith(BLOCK_PREFIX))
if (TooltipHelper.hasTooltip(stack, event.getPlayer())) {
List<Component> itemTooltip = event.getToolTip();
List<Component> toolTip = new ArrayList<>();
toolTip.add(itemTooltip.remove(0));
TooltipHelper.getTooltip(stack).addInformation(toolTip);
itemTooltip.addAll(0, toolTip);
}
if (stack.getItem() instanceof BlockItem) {
BlockItem item = (BlockItem) stack.getItem();
if (item.getBlock() instanceof IRotate || item.getBlock() instanceof EngineBlock) {
List<Component> kineticStats = ItemDescription.getKineticStats(item.getBlock());
if (!kineticStats.isEmpty()) {
event.getToolTip().add(new TextComponent(""));
event.getToolTip().addAll(kineticStats);
}
}
}
PonderTooltipHandler.addToTooltip(event.getToolTip(), stack);
SequencedAssemblyRecipe.addToTooltip(event.getToolTip(), stack);
}
Aggregations