mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-30 06:45:03 +01:00
assorted trivial stuff
This commit is contained in:
parent
55562e5d16
commit
559460e514
26 changed files with 82 additions and 88 deletions
|
@ -709,9 +709,9 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void outOfWorld() {
|
protected void onBelowWorld() {
|
||||||
ejectPassengers();
|
ejectPassengers();
|
||||||
super.outOfWorld();
|
super.onBelowWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidTank;
|
import net.minecraftforge.fluids.IFluidTank;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||||
import net.minecraftforge.network.PacketDistributor;
|
import net.minecraftforge.network.PacketDistributor;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SandPaperPolishingRecipe extends ProcessingRecipe<SandPaperInv> {
|
||||||
List<Recipe<SandPaperInv>> matchingRecipes = getMatchingRecipes(world, stack);
|
List<Recipe<SandPaperInv>> matchingRecipes = getMatchingRecipes(world, stack);
|
||||||
if (!matchingRecipes.isEmpty())
|
if (!matchingRecipes.isEmpty())
|
||||||
return matchingRecipes.get(0)
|
return matchingRecipes.get(0)
|
||||||
.assemble(new SandPaperInv(stack))
|
.assemble(new SandPaperInv(stack), world.registryAccess())
|
||||||
.copy();
|
.copy();
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.FluidState;
|
import net.minecraft.world.level.material.FluidState;
|
||||||
import net.minecraft.world.level.material.Material;
|
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
@ -271,10 +270,7 @@ public class SymmetryWandItem extends Item {
|
||||||
|
|
||||||
private static boolean isHoldingBlock(Player player, BlockState block) {
|
private static boolean isHoldingBlock(Player player, BlockState block) {
|
||||||
ItemStack itemBlock = BlockHelper.getRequiredItem(block);
|
ItemStack itemBlock = BlockHelper.getRequiredItem(block);
|
||||||
return player.getMainHandItem()
|
return player.isHolding(itemBlock.getItem());
|
||||||
.sameItem(itemBlock)
|
|
||||||
|| player.getOffhandItem()
|
|
||||||
.sameItem(itemBlock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void remove(Level world, ItemStack wand, Player player, BlockPos pos) {
|
public static void remove(Level world, ItemStack wand, Player player, BlockPos pos) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
|
@ -144,15 +145,16 @@ public class RecipeGridHandler {
|
||||||
items.calcStats();
|
items.calcStats();
|
||||||
CraftingContainer craftinginventory = new MechanicalCraftingInventory(items);
|
CraftingContainer craftinginventory = new MechanicalCraftingInventory(items);
|
||||||
ItemStack result = null;
|
ItemStack result = null;
|
||||||
|
RegistryAccess registryAccess = world.registryAccess();
|
||||||
if (AllConfigs.server().recipes.allowRegularCraftingInCrafter.get())
|
if (AllConfigs.server().recipes.allowRegularCraftingInCrafter.get())
|
||||||
result = world.getRecipeManager()
|
result = world.getRecipeManager()
|
||||||
.getRecipeFor(RecipeType.CRAFTING, craftinginventory, world)
|
.getRecipeFor(RecipeType.CRAFTING, craftinginventory, world)
|
||||||
.filter(r -> isRecipeAllowed(r, craftinginventory))
|
.filter(r -> isRecipeAllowed(r, craftinginventory))
|
||||||
.map(r -> r.assemble(craftinginventory))
|
.map(r -> r.assemble(craftinginventory, registryAccess))
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (result == null)
|
if (result == null)
|
||||||
result = AllRecipeTypes.MECHANICAL_CRAFTING.find(craftinginventory, world)
|
result = AllRecipeTypes.MECHANICAL_CRAFTING.find(craftinginventory, world)
|
||||||
.map(r -> r.assemble(craftinginventory))
|
.map(r -> r.assemble(craftinginventory, registryAccess))
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.core.particles.DustParticleOptions;
|
import net.minecraft.core.particles.DustParticleOptions;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
@ -177,10 +178,11 @@ public class FanProcessing {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smeltingRecipe.isPresent()) {
|
if (smeltingRecipe.isPresent()) {
|
||||||
if (!smokingRecipe.isPresent() || !ItemStack.isSame(smokingRecipe.get()
|
RegistryAccess registryAccess = world.registryAccess();
|
||||||
.getResultItem(),
|
if (smokingRecipe.isEmpty() || !ItemStack.isSameItem(smokingRecipe.get()
|
||||||
|
.getResultItem(registryAccess),
|
||||||
smeltingRecipe.get()
|
smeltingRecipe.get()
|
||||||
.getResultItem())) {
|
.getResultItem(registryAccess))) {
|
||||||
return RecipeApplier.applyRecipeOn(stack, smeltingRecipe.get());
|
return RecipeApplier.applyRecipeOn(stack, smeltingRecipe.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +241,7 @@ public class FanProcessing {
|
||||||
|
|
||||||
if (entity instanceof EnderMan || entity.getType() == EntityType.SNOW_GOLEM
|
if (entity instanceof EnderMan || entity.getType() == EntityType.SNOW_GOLEM
|
||||||
|| entity.getType() == EntityType.BLAZE) {
|
|| entity.getType() == EntityType.BLAZE) {
|
||||||
entity.hurt(DamageSource.DROWN, 2);
|
entity.hurt(entity.damageSources().drown(), 2);
|
||||||
}
|
}
|
||||||
if (entity.isOnFire()) {
|
if (entity.isOnFire()) {
|
||||||
entity.clearFire();
|
entity.clearFire();
|
||||||
|
|
|
@ -653,13 +653,13 @@ public class AllArmInteractionPointTypes {
|
||||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||||
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
||||||
return stack;
|
return stack;
|
||||||
if (!jukeboxBE.getRecord()
|
if (!jukeboxBE.getFirstItem()
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
return stack;
|
return stack;
|
||||||
ItemStack remainder = stack.copy();
|
ItemStack remainder = stack.copy();
|
||||||
ItemStack toInsert = remainder.split(1);
|
ItemStack toInsert = remainder.split(1);
|
||||||
if (!simulate) {
|
if (!simulate) {
|
||||||
jukeboxBE.setRecord(toInsert);
|
jukeboxBE.setFirstItem(toInsert);
|
||||||
level.setBlock(pos, cachedState.setValue(JukeboxBlock.HAS_RECORD, true), 2);
|
level.setBlock(pos, cachedState.setValue(JukeboxBlock.HAS_RECORD, true), 2);
|
||||||
level.levelEvent(null, 1010, pos, Item.getId(item));
|
level.levelEvent(null, 1010, pos, Item.getId(item));
|
||||||
}
|
}
|
||||||
|
@ -674,7 +674,7 @@ public class AllArmInteractionPointTypes {
|
||||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||||
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
ItemStack record = jukeboxBE.getRecord();
|
ItemStack record = jukeboxBE.getFirstItem();
|
||||||
if (record.isEmpty())
|
if (record.isEmpty())
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
if (!simulate) {
|
if (!simulate) {
|
||||||
|
@ -705,7 +705,7 @@ public class AllArmInteractionPointTypes {
|
||||||
.orElse(4) == 4)
|
.orElse(4) == 4)
|
||||||
return stack;
|
return stack;
|
||||||
if (!simulate)
|
if (!simulate)
|
||||||
RespawnAnchorBlock.charge(level, pos, cachedState);
|
RespawnAnchorBlock.charge(null, level, pos, cachedState);
|
||||||
ItemStack remainder = stack.copy();
|
ItemStack remainder = stack.copy();
|
||||||
remainder.shrink(1);
|
remainder.shrink(1);
|
||||||
return remainder;
|
return remainder;
|
||||||
|
|
|
@ -337,7 +337,7 @@ public class ArmBlockEntity extends KineticBlockEntity implements ITransformable
|
||||||
protected int getDistributableAmount(ArmInteractionPoint armInteractionPoint, int i) {
|
protected int getDistributableAmount(ArmInteractionPoint armInteractionPoint, int i) {
|
||||||
ItemStack stack = armInteractionPoint.extract(i, true);
|
ItemStack stack = armInteractionPoint.extract(i, true);
|
||||||
ItemStack remainder = simulateInsertion(stack);
|
ItemStack remainder = simulateInsertion(stack);
|
||||||
if (stack.sameItem(remainder)) {
|
if (ItemStack.isSameItem(stack, remainder)) {
|
||||||
return stack.getCount() - remainder.getCount();
|
return stack.getCount() - remainder.getCount();
|
||||||
} else {
|
} else {
|
||||||
return stack.getCount();
|
return stack.getCount();
|
||||||
|
@ -391,7 +391,7 @@ public class ArmBlockEntity extends KineticBlockEntity implements ITransformable
|
||||||
sendData();
|
sendData();
|
||||||
setChanged();
|
setChanged();
|
||||||
|
|
||||||
if (!prevHeld.sameItem(heldItem))
|
if (!ItemStack.isSameItem(heldItem, prevHeld))
|
||||||
level.playSound(null, worldPosition, SoundEvents.ITEM_PICKUP, SoundSource.BLOCKS, .125f,
|
level.playSound(null, worldPosition, SoundEvents.ITEM_PICKUP, SoundSource.BLOCKS, .125f,
|
||||||
.5f + Create.RANDOM.nextFloat() * .25f);
|
.5f + Create.RANDOM.nextFloat() * .25f);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -43,7 +43,6 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
||||||
import net.minecraftforge.common.crafting.IShapedRecipe;
|
import net.minecraftforge.common.crafting.IShapedRecipe;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
public class MechanicalMixerBlockEntity extends BasinOperatingBlockEntity {
|
public class MechanicalMixerBlockEntity extends BasinOperatingBlockEntity {
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class EjectorBlockEntity extends KineticBlockEntity {
|
||||||
;
|
;
|
||||||
else if (remainder.isEmpty())
|
else if (remainder.isEmpty())
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
else if (!remainder.sameItem(stack))
|
else if (!ItemStack.isSameItem(remainder, stack))
|
||||||
transportedItemStack.stack = remainder;
|
transportedItemStack.stack = remainder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -546,8 +546,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
if (simulate)
|
if (simulate)
|
||||||
return true;
|
return true;
|
||||||
for (ItemStack itemStack : outputItems) {
|
for (ItemStack itemStack : outputItems) {
|
||||||
if (itemStack.hasCraftingRemainingItem() && itemStack.getCraftingRemainingItem()
|
if (itemStack.hasCraftingRemainingItem() && ItemStack.isSameItem(itemStack, itemStack.getCraftingRemainingItem()))
|
||||||
.sameItem(itemStack))
|
|
||||||
continue;
|
continue;
|
||||||
spoutputBuffer.add(itemStack.copy());
|
spoutputBuffer.add(itemStack.copy());
|
||||||
}
|
}
|
||||||
|
@ -591,8 +590,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
private boolean acceptItemOutputsIntoBasin(List<ItemStack> outputItems, boolean simulate, IItemHandler targetInv) {
|
private boolean acceptItemOutputsIntoBasin(List<ItemStack> outputItems, boolean simulate, IItemHandler targetInv) {
|
||||||
for (ItemStack itemStack : outputItems) {
|
for (ItemStack itemStack : outputItems) {
|
||||||
// Catalyst items are never consumed
|
// Catalyst items are never consumed
|
||||||
if (itemStack.hasCraftingRemainingItem() && itemStack.getCraftingRemainingItem()
|
if (itemStack.hasCraftingRemainingItem() && ItemStack.isSameItem(itemStack, itemStack.getCraftingRemainingItem()))
|
||||||
.sameItem(itemStack))
|
|
||||||
continue;
|
continue;
|
||||||
if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), simulate)
|
if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), simulate)
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
|
|
|
@ -17,6 +17,7 @@ import com.simibubi.create.foundation.recipe.IRecipeTypeInfo;
|
||||||
|
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.Container;
|
import net.minecraft.world.Container;
|
||||||
|
@ -170,8 +171,8 @@ public abstract class ProcessingRecipe<T extends Container> implements Recipe<T>
|
||||||
// IRecipe<> paperwork
|
// IRecipe<> paperwork
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack assemble(T inv) {
|
public ItemStack assemble(T inv, RegistryAccess registryAccess) {
|
||||||
return getResultItem();
|
return getResultItem(registryAccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -180,7 +181,7 @@ public abstract class ProcessingRecipe<T extends Container> implements Recipe<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getResultItem() {
|
public ItemStack getResultItem(RegistryAccess registryAccess) {
|
||||||
return getRollableResults().isEmpty() ? ItemStack.EMPTY
|
return getRollableResults().isEmpty() ? ItemStack.EMPTY
|
||||||
: getRollableResults().get(0)
|
: getRollableResults().get(0)
|
||||||
.getStack();
|
.getStack();
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.simibubi.create.foundation.utility.Pair;
|
||||||
|
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -178,7 +179,7 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack assemble(RecipeWrapper p_77572_1_) {
|
public ItemStack assemble(RecipeWrapper inv, RegistryAccess registryAccess) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +189,7 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getResultItem() {
|
public ItemStack getResultItem(RegistryAccess registryAccess) {
|
||||||
return resultPool.get(0)
|
return resultPool.get(0)
|
||||||
.getStack();
|
.getStack();
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class LinkBehaviour extends BlockEntityBehaviour implements IRedstoneLink
|
||||||
stack = stack.copy();
|
stack = stack.copy();
|
||||||
stack.setCount(1);
|
stack.setCount(1);
|
||||||
ItemStack toCompare = first ? frequencyFirst.getStack() : frequencyLast.getStack();
|
ItemStack toCompare = first ? frequencyFirst.getStack() : frequencyLast.getStack();
|
||||||
boolean changed = !ItemStack.isSame(stack, toCompare) || !ItemStack.tagMatches(stack, toCompare);
|
boolean changed = !ItemStack.isSameItemSameTags(stack, toCompare);
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
getHandler().removeFromNetwork(getWorld(), this);
|
getHandler().removeFromNetwork(getWorld(), this);
|
||||||
|
|
|
@ -29,12 +29,12 @@ public class SchematicannonInventory extends ItemStackHandler {
|
||||||
case 1: // Blueprint output
|
case 1: // Blueprint output
|
||||||
return false;
|
return false;
|
||||||
case 2: // Book input
|
case 2: // Book input
|
||||||
return AllBlocks.CLIPBOARD.isIn(stack) || stack.sameItem(new ItemStack(Items.BOOK))
|
return AllBlocks.CLIPBOARD.isIn(stack) || stack.is(Items.BOOK)
|
||||||
|| stack.sameItem(new ItemStack(Items.WRITTEN_BOOK));
|
|| stack.is(Items.WRITTEN_BOOK);
|
||||||
case 3: // Material List output
|
case 3: // Material List output
|
||||||
return false;
|
return false;
|
||||||
case 4: // Gunpowder
|
case 4: // Gunpowder
|
||||||
return stack.sameItem(new ItemStack(Items.GUNPOWDER));
|
return stack.is(Items.GUNPOWDER);
|
||||||
default:
|
default:
|
||||||
return super.isItemValid(slot, stack);
|
return super.isItemValid(slot, stack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class ItemRequirement {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matches(ItemStack other) {
|
public boolean matches(ItemStack other) {
|
||||||
return stack.sameItem(other);
|
return ItemStack.isSameItem(stack, other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
import net.minecraft.world.item.context.UseOnContext;
|
import net.minecraft.world.item.context.UseOnContext;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.LevelReader;
|
import net.minecraft.world.level.LevelReader;
|
||||||
|
import net.minecraft.world.level.SignalGetter;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
@ -57,7 +58,7 @@ public class SignalBlock extends Block implements IBE<SignalBlockEntity>, IWrenc
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldCheckWeakPower(BlockState state, LevelReader world, BlockPos pos, Direction side) {
|
public boolean shouldCheckWeakPower(BlockState state, SignalGetter level, BlockPos pos, Direction side) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.simibubi.create.Create;
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.advancements.CriterionTrigger;
|
import net.minecraft.advancements.CriterionTrigger;
|
||||||
import net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance;
|
import net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance;
|
||||||
|
import net.minecraft.advancements.critereon.ContextAwarePredicate;
|
||||||
import net.minecraft.advancements.critereon.EntityPredicate;
|
import net.minecraft.advancements.critereon.EntityPredicate;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.server.PlayerAdvancements;
|
import net.minecraft.server.PlayerAdvancements;
|
||||||
|
@ -80,8 +81,8 @@ public abstract class CriterionTriggerBase<T extends CriterionTriggerBase.Instan
|
||||||
|
|
||||||
public abstract static class Instance extends AbstractCriterionTriggerInstance {
|
public abstract static class Instance extends AbstractCriterionTriggerInstance {
|
||||||
|
|
||||||
public Instance(ResourceLocation idIn, EntityPredicate.Composite p_i231464_2_) {
|
public Instance(ResourceLocation idIn, ContextAwarePredicate predicate) {
|
||||||
super(idIn, p_i231464_2_);
|
super(idIn, predicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract boolean test(@Nullable List<Supplier<Object>> suppliers);
|
protected abstract boolean test(@Nullable List<Supplier<Object>> suppliers);
|
||||||
|
|
|
@ -9,6 +9,7 @@ import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
|
import net.minecraft.advancements.critereon.ContextAwarePredicate;
|
||||||
import net.minecraft.advancements.critereon.DeserializationContext;
|
import net.minecraft.advancements.critereon.DeserializationContext;
|
||||||
import net.minecraft.advancements.critereon.EntityPredicate;
|
import net.minecraft.advancements.critereon.EntityPredicate;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -38,7 +39,7 @@ public class SimpleCreateTrigger extends CriterionTriggerBase<SimpleCreateTrigge
|
||||||
public static class Instance extends CriterionTriggerBase.Instance {
|
public static class Instance extends CriterionTriggerBase.Instance {
|
||||||
|
|
||||||
public Instance(ResourceLocation idIn) {
|
public Instance(ResourceLocation idIn) {
|
||||||
super(idIn, EntityPredicate.Composite.ANY);
|
super(idIn, ContextAwarePredicate.ANY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class ModularGuiLineBuilder {
|
||||||
EditBox input = new EditBox(font, x + this.x + 5, y, width - 9, 8, Components.immutableEmpty());
|
EditBox input = new EditBox(font, x + this.x + 5, y, width - 9, 8, Components.immutableEmpty());
|
||||||
input.setBordered(false);
|
input.setBordered(false);
|
||||||
input.setTextColor(0xffffff);
|
input.setTextColor(0xffffff);
|
||||||
input.changeFocus(false);
|
input.setFocused(false);
|
||||||
input.mouseClicked(0, 0, 0);
|
input.mouseClicked(0, 0, 0);
|
||||||
TooltipArea tooltipArea = new TooltipArea(this.x + x, y - 4, width, 18);
|
TooltipArea tooltipArea = new TooltipArea(this.x + x, y - 4, width, 18);
|
||||||
inputTransform.accept(input, tooltipArea);
|
inputTransform.accept(input, tooltipArea);
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.simibubi.create.foundation.gui.TickableGuiEventListener;
|
import com.simibubi.create.foundation.gui.TickableGuiEventListener;
|
||||||
import com.simibubi.create.foundation.utility.Components;
|
import com.simibubi.create.foundation.utility.Components;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -63,26 +64,22 @@ public abstract class AbstractSimiWidget extends AbstractWidget implements Ticka
|
||||||
public void tick() {}
|
public void tick() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
public void renderWidget(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (visible) {
|
beforeRender(graphics, mouseX, mouseY, partialTicks);
|
||||||
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;
|
renderButton(graphics, mouseX, mouseY, partialTicks);
|
||||||
beforeRender(ms, mouseX, mouseY, partialTicks);
|
afterRender(graphics, mouseX, mouseY, partialTicks);
|
||||||
renderButton(ms, mouseX, mouseY, partialTicks);
|
wasHovered = isHoveredOrFocused();
|
||||||
afterRender(ms, mouseX, mouseY, partialTicks);
|
|
||||||
wasHovered = isHoveredOrFocused();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void beforeRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
protected void beforeRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
ms.pushPose();
|
graphics.pose().pushPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
protected void renderButton(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
public void renderButton(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void afterRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
protected void afterRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
ms.popPose();
|
graphics.pose().popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runCallback(double mouseX, double mouseY) {
|
public void runCallback(double mouseX, double mouseY) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.simibubi.create.foundation.utility.Components;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ public class Label extends AbstractSimiWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderButton(@Nonnull PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
protected void renderButton(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (text == null || text.getString().isEmpty())
|
if (text == null || text.getString().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -80,10 +81,7 @@ public class Label extends AbstractSimiWidget {
|
||||||
if (suffix != null && !suffix.isEmpty())
|
if (suffix != null && !suffix.isEmpty())
|
||||||
copy.append(suffix);
|
copy.append(suffix);
|
||||||
|
|
||||||
if (hasShadow)
|
graphics.drawString(font, copy, getX(), getY(), color, hasShadow);
|
||||||
font.drawShadow(matrixStack, copy, getX(), getY(), color);
|
|
||||||
else
|
|
||||||
font.draw(matrixStack, copy, getX(), getY(), color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class ItemHelper {
|
||||||
return true;
|
return true;
|
||||||
if (stacks1.length == stacks2.length) {
|
if (stacks1.length == stacks2.length) {
|
||||||
for (int i = 0; i < stacks1.length; i++)
|
for (int i = 0; i < stacks1.length; i++)
|
||||||
if (!ItemStack.isSame(stacks1[i], stacks2[i]))
|
if (!ItemStack.isSameItem(stacks1[i], stacks2[i]))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ import net.minecraft.world.level.block.state.properties.SlabType;
|
||||||
import net.minecraft.world.level.chunk.LevelChunk;
|
import net.minecraft.world.level.chunk.LevelChunk;
|
||||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||||
import net.minecraft.world.level.material.FluidState;
|
import net.minecraft.world.level.material.FluidState;
|
||||||
import net.minecraft.world.level.material.Material;
|
|
||||||
import net.minecraftforge.common.IPlantable;
|
import net.minecraftforge.common.IPlantable;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.level.BlockEvent;
|
import net.minecraftforge.event.level.BlockEvent;
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class WrappedWorld extends Level {
|
||||||
protected LevelEntityGetter<Entity> entityGetter = new DummyLevelEntityGetter<>();
|
protected LevelEntityGetter<Entity> entityGetter = new DummyLevelEntityGetter<>();
|
||||||
|
|
||||||
public WrappedWorld(Level world) {
|
public WrappedWorld(Level world) {
|
||||||
super((WritableLevelData) world.getLevelData(), world.dimension(), world.dimensionTypeRegistration(),
|
super((WritableLevelData) world.getLevelData(), world.dimension(), world.registryAccess(), world.dimensionTypeRegistration(),
|
||||||
world::getProfiler, world.isClientSide, world.isDebug(), 0, 0);
|
world::getProfiler, world.isClientSide, world.isDebug(), 0, 0);
|
||||||
this.world = world;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||||
|
|
||||||
public class HosePulleyScenes {
|
public class HosePulleyScenes {
|
||||||
|
|
Loading…
Reference in a new issue