New version who dis?

- Port to 1.18
- ChunkUtil discontinued
- SmartTileEntities write to metadata
- Features generate from -64 up
- World Wrappers weren't convoluted enough
- Haunted bell considers >0 safe
- Missing GuiUtils methods continued in RemovedGuiUtils
This commit is contained in:
simibubi 2021-12-07 18:24:57 +01:00
parent 9362374b1e
commit 061b85d515
189 changed files with 1051 additions and 1097 deletions

View file

@ -21,7 +21,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
// apply plugin: 'org.parchmentmc.librarian.forgegradle'
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
// jozu: I use a gradle workspace with both projects.
@ -35,11 +35,12 @@ version = "mc${minecraft_version}_v${mod_version}" + (dev && !buildnumber.equals
group = 'com.simibubi.create'
archivesBaseName = 'create'
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
// mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
mappings channel: 'official', version: "${minecraft_version}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {

View file

@ -5,8 +5,8 @@ org.gradle.daemon = false
# mod version info
mod_version = 0.4
minecraft_version = 1.17.1
forge_version = 37.1.0
minecraft_version = 1.18
forge_version = 38.0.15
# build dependency versions
forgegradle_version = 5.1.+
@ -18,9 +18,9 @@ cursegradle_version = 1.4.0
parchment_version = 2021.10.31
# dependency versions
registrate_version = MC1.17.1-1.0.14
flywheel_version = 1.17-0.3.0.21
jei_version = 8.2.0.36
registrate_version = MC1.18-1.0.21
flywheel_version = 1.18-0.3.0.1
jei_version = 9.0.0.40
# curseforge information
projectId = 328085

View file

@ -217,7 +217,7 @@ import net.minecraftforge.common.Tags;
public class AllBlocks {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.itemGroup(() -> Create.BASE_CREATIVE_TAB);
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
// Schematics

View file

@ -14,9 +14,9 @@ import com.simibubi.create.content.schematics.block.SchematicTableContainer;
import com.simibubi.create.content.schematics.block.SchematicTableScreen;
import com.simibubi.create.content.schematics.block.SchematicannonContainer;
import com.simibubi.create.content.schematics.block.SchematicannonScreen;
import com.tterrag.registrate.builders.ContainerBuilder.ForgeContainerFactory;
import com.tterrag.registrate.builders.ContainerBuilder.ScreenFactory;
import com.tterrag.registrate.util.entry.ContainerEntry;
import com.tterrag.registrate.builders.MenuBuilder.ForgeMenuFactory;
import com.tterrag.registrate.builders.MenuBuilder.ScreenFactory;
import com.tterrag.registrate.util.entry.MenuEntry;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.client.gui.screens.Screen;
@ -25,29 +25,32 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
public class AllContainerTypes {
public static final ContainerEntry<SchematicTableContainer> SCHEMATIC_TABLE =
public static final MenuEntry<SchematicTableContainer> SCHEMATIC_TABLE =
register("schematic_table", SchematicTableContainer::new, () -> SchematicTableScreen::new);
public static final ContainerEntry<SchematicannonContainer> SCHEMATICANNON =
public static final MenuEntry<SchematicannonContainer> SCHEMATICANNON =
register("schematicannon", SchematicannonContainer::new, () -> SchematicannonScreen::new);
public static final ContainerEntry<FilterContainer> FILTER =
public static final MenuEntry<FilterContainer> FILTER =
register("filter", FilterContainer::new, () -> FilterScreen::new);
public static final ContainerEntry<AttributeFilterContainer> ATTRIBUTE_FILTER =
public static final MenuEntry<AttributeFilterContainer> ATTRIBUTE_FILTER =
register("attribute_filter", AttributeFilterContainer::new, () -> AttributeFilterScreen::new);
public static final ContainerEntry<BlueprintContainer> CRAFTING_BLUEPRINT =
public static final MenuEntry<BlueprintContainer> CRAFTING_BLUEPRINT =
register("crafting_blueprint", BlueprintContainer::new, () -> BlueprintScreen::new);
public static final ContainerEntry<LinkedControllerContainer> LINKED_CONTROLLER =
public static final MenuEntry<LinkedControllerContainer> LINKED_CONTROLLER =
register("linked_controller", LinkedControllerContainer::new, () -> LinkedControllerScreen::new);
public static final ContainerEntry<ToolboxContainer> TOOLBOX =
public static final MenuEntry<ToolboxContainer> TOOLBOX =
register("toolbox", ToolboxContainer::new, () -> ToolboxScreen::new);
private static <C extends AbstractContainerMenu, S extends Screen & MenuAccess<C>> ContainerEntry<C> register(String name, ForgeContainerFactory<C> factory, NonNullSupplier<ScreenFactory<C, S>> screenFactory) {
return Create.registrate().container(name, factory, screenFactory).register();
private static <C extends AbstractContainerMenu, S extends Screen & MenuAccess<C>> MenuEntry<C> register(
String name, ForgeMenuFactory<C> factory, NonNullSupplier<ScreenFactory<C, S>> screenFactory) {
return Create.registrate()
.menu(name, factory, screenFactory)
.register();
}
public static void register() {}

View file

@ -62,7 +62,7 @@ import net.minecraftforge.common.Tags;
public class AllItems {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.itemGroup(() -> Create.BASE_CREATIVE_TAB);
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
// Schematics

View file

@ -5,7 +5,7 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraftforge.fmlclient.registry.ClientRegistry;
import net.minecraftforge.client.ClientRegistry;
public enum AllKeys {

View file

@ -31,7 +31,7 @@ import net.minecraftforge.common.Tags;
public class AllTags {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.itemGroup(() -> Create.BASE_CREATIVE_TAB);
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
public static <T> Tag.Named<T> tag(Function<ResourceLocation, Tag.Named<T>> wrapperFactory, String namespace,
String path) {

View file

@ -171,108 +171,108 @@ import com.simibubi.create.content.schematics.block.SchematicannonInstance;
import com.simibubi.create.content.schematics.block.SchematicannonRenderer;
import com.simibubi.create.content.schematics.block.SchematicannonTileEntity;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import com.tterrag.registrate.util.entry.TileEntityEntry;
import com.tterrag.registrate.util.entry.BlockEntityEntry;
public class AllTileEntities {
// Schematics
public static final TileEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = Create.registrate()
public static final BlockEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = Create.registrate()
.tileEntity("schematicannon", SchematicannonTileEntity::new)
.instance(() -> SchematicannonInstance::new)
.validBlocks(AllBlocks.SCHEMATICANNON)
.renderer(() -> SchematicannonRenderer::new)
.register();
public static final TileEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = Create.registrate()
public static final BlockEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = Create.registrate()
.tileEntity("schematic_table", SchematicTableTileEntity::new)
.validBlocks(AllBlocks.SCHEMATIC_TABLE)
.register();
// Kinetics
public static final TileEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate()
public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate()
.tileEntity("simple_kinetic", BracketedKineticTileEntity::new)
.instance(() -> BracketedKineticTileInstance::new)
.validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL)
.renderer(() -> BracketedKineticTileRenderer::new)
.register();
public static final TileEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate()
public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate()
.tileEntity("motor", CreativeMotorTileEntity::new)
.instance(() -> HalfShaftInstance::new)
.validBlocks(AllBlocks.CREATIVE_MOTOR)
.renderer(() -> CreativeMotorRenderer::new)
.register();
public static final TileEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate()
public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate()
.tileEntity("gearbox", GearboxTileEntity::new)
.instance(() -> GearboxInstance::new)
.validBlocks(AllBlocks.GEARBOX)
.renderer(() -> GearboxRenderer::new)
.register();
public static final TileEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate()
public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate()
.tileEntity("encased_shaft", KineticTileEntity::new)
.instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE)
.renderer(() -> ShaftRenderer::new)
.register();
public static final TileEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate()
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate()
.tileEntity("encased_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::small)
.validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL)
.renderer(() -> EncasedCogRenderer::small)
.register();
public static final TileEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = Create.registrate()
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = Create.registrate()
.tileEntity("encased_large_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::large)
.validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL)
.renderer(() -> EncasedCogRenderer::large)
.register();
public static final TileEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate()
public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate()
.tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new)
.instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.renderer(() -> ShaftRenderer::new)
.register();
public static final TileEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate()
public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate()
.tileEntity("encased_fan", EncasedFanTileEntity::new)
.instance(() -> FanInstance::new)
.validBlocks(AllBlocks.ENCASED_FAN)
.renderer(() -> EncasedFanRenderer::new)
.register();
public static final TileEntityEntry<NozzleTileEntity> NOZZLE = Create.registrate()
public static final BlockEntityEntry<NozzleTileEntity> NOZZLE = Create.registrate()
.tileEntity("nozzle", NozzleTileEntity::new)
.validBlocks(AllBlocks.NOZZLE)
// .renderer(() -> renderer)
.register();
public static final TileEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate()
public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate()
.tileEntity("clutch", ClutchTileEntity::new)
.instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.CLUTCH)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final TileEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate()
public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate()
.tileEntity("gearshift", GearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final TileEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate()
public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate()
.tileEntity("turntable", TurntableTileEntity::new)
.instance(() -> SingleRotatingInstance::new)
.validBlocks(AllBlocks.TURNTABLE)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final TileEntityEntry<HandCrankTileEntity> HAND_CRANK = Create.registrate()
public static final BlockEntityEntry<HandCrankTileEntity> HAND_CRANK = Create.registrate()
.tileEntity("hand_crank", HandCrankTileEntity::new)
.instance(() -> HandCrankInstance::new)
.validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE)
@ -280,383 +280,383 @@ public class AllTileEntities {
.renderer(() -> HandCrankRenderer::new)
.register();
public static final TileEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = Create.registrate()
public static final BlockEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = Create.registrate()
.tileEntity("cuckoo_clock", CuckooClockTileEntity::new)
.instance(() -> HorizontalHalfShaftInstance::new)
.validBlocks(AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK)
.renderer(() -> CuckooClockRenderer::new)
.register();
public static final TileEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate()
public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate()
.tileEntity("gantry_shaft", GantryShaftTileEntity::new)
.instance(() -> SingleRotatingInstance::new)
.validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final TileEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = Create.registrate()
public static final BlockEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = Create.registrate()
.tileEntity("gantry_pinion", GantryCarriageTileEntity::new)
.instance(() -> GantryCarriageInstance::new)
.validBlocks(AllBlocks.GANTRY_CARRIAGE)
.renderer(() -> GantryCarriageRenderer::new)
.register();
public static final TileEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
public static final BlockEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
.tileEntity("mechanical_pump", PumpTileEntity::new)
.instance(() -> PumpCogInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PUMP)
.renderer(() -> PumpRenderer::new)
.register();
public static final TileEntityEntry<SmartFluidPipeTileEntity> SMART_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<SmartFluidPipeTileEntity> SMART_FLUID_PIPE = Create.registrate()
.tileEntity("smart_fluid_pipe", SmartFluidPipeTileEntity::new)
.validBlocks(AllBlocks.SMART_FLUID_PIPE)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final TileEntityEntry<FluidPipeTileEntity> FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<FluidPipeTileEntity> FLUID_PIPE = Create.registrate()
.tileEntity("fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.FLUID_PIPE)
.register();
public static final TileEntityEntry<FluidPipeTileEntity> ENCASED_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<FluidPipeTileEntity> ENCASED_FLUID_PIPE = Create.registrate()
.tileEntity("encased_fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.ENCASED_FLUID_PIPE)
.register();
public static final TileEntityEntry<StraightPipeTileEntity> GLASS_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<StraightPipeTileEntity> GLASS_FLUID_PIPE = Create.registrate()
.tileEntity("glass_fluid_pipe", StraightPipeTileEntity::new)
.validBlocks(AllBlocks.GLASS_FLUID_PIPE)
.renderer(() -> TransparentStraightPipeRenderer::new)
.register();
public static final TileEntityEntry<FluidValveTileEntity> FLUID_VALVE = Create.registrate()
public static final BlockEntityEntry<FluidValveTileEntity> FLUID_VALVE = Create.registrate()
.tileEntity("fluid_valve", FluidValveTileEntity::new)
.instance(() -> FluidValveInstance::new)
.validBlocks(AllBlocks.FLUID_VALVE)
.renderer(() -> FluidValveRenderer::new)
.register();
public static final TileEntityEntry<FluidTankTileEntity> FLUID_TANK = Create.registrate()
public static final BlockEntityEntry<FluidTankTileEntity> FLUID_TANK = Create.registrate()
.tileEntity("fluid_tank", FluidTankTileEntity::new)
.validBlocks(AllBlocks.FLUID_TANK)
.renderer(() -> FluidTankRenderer::new)
.register();
public static final TileEntityEntry<CreativeFluidTankTileEntity> CREATIVE_FLUID_TANK = Create.registrate()
public static final BlockEntityEntry<CreativeFluidTankTileEntity> CREATIVE_FLUID_TANK = Create.registrate()
.tileEntity("creative_fluid_tank", CreativeFluidTankTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_FLUID_TANK)
.renderer(() -> FluidTankRenderer::new)
.register();
public static final TileEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = Create.registrate()
public static final BlockEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = Create.registrate()
.tileEntity("hose_pulley", HosePulleyTileEntity::new)
.instance(() -> HosePulleyInstance::new)
.validBlocks(AllBlocks.HOSE_PULLEY)
.renderer(() -> HosePulleyRenderer::new)
.register();
public static final TileEntityEntry<SpoutTileEntity> SPOUT = Create.registrate()
public static final BlockEntityEntry<SpoutTileEntity> SPOUT = Create.registrate()
.tileEntity("spout", SpoutTileEntity::new)
.validBlocks(AllBlocks.SPOUT)
.renderer(() -> SpoutRenderer::new)
.register();
public static final TileEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = Create.registrate()
public static final BlockEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = Create.registrate()
.tileEntity("item_drain", ItemDrainTileEntity::new)
.validBlocks(AllBlocks.ITEM_DRAIN)
.renderer(() -> ItemDrainRenderer::new)
.register();
public static final TileEntityEntry<BeltTileEntity> BELT = Create.registrate()
public static final BlockEntityEntry<BeltTileEntity> BELT = Create.registrate()
.tileEntity("belt", BeltTileEntity::new)
.instance(() -> BeltInstance::new)
.validBlocks(AllBlocks.BELT)
.renderer(() -> BeltRenderer::new)
.register();
public static final TileEntityEntry<ChuteTileEntity> CHUTE = Create.registrate()
public static final BlockEntityEntry<ChuteTileEntity> CHUTE = Create.registrate()
.tileEntity("chute", ChuteTileEntity::new)
.validBlocks(AllBlocks.CHUTE)
.renderer(() -> ChuteRenderer::new)
.register();
public static final TileEntityEntry<SmartChuteTileEntity> SMART_CHUTE = Create.registrate()
public static final BlockEntityEntry<SmartChuteTileEntity> SMART_CHUTE = Create.registrate()
.tileEntity("smart_chute", SmartChuteTileEntity::new)
.validBlocks(AllBlocks.SMART_CHUTE)
.renderer(() -> SmartChuteRenderer::new)
.register();
public static final TileEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = Create.registrate()
public static final BlockEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = Create.registrate()
.tileEntity("andesite_tunnel", BeltTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.ANDESITE_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final TileEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = Create.registrate()
public static final BlockEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = Create.registrate()
.tileEntity("brass_tunnel", BrassTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.BRASS_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final TileEntityEntry<ArmTileEntity> MECHANICAL_ARM = Create.registrate()
public static final BlockEntityEntry<ArmTileEntity> MECHANICAL_ARM = Create.registrate()
.tileEntity("mechanical_arm", ArmTileEntity::new)
.instance(() -> ArmInstance::new)
.validBlocks(AllBlocks.MECHANICAL_ARM)
.renderer(() -> ArmRenderer::new)
.register();
public static final TileEntityEntry<ItemVaultTileEntity> ITEM_VAULT = Create.registrate()
public static final BlockEntityEntry<ItemVaultTileEntity> ITEM_VAULT = Create.registrate()
.tileEntity("item_vault", ItemVaultTileEntity::new)
.validBlocks(AllBlocks.ITEM_VAULT)
.register();
public static final TileEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate()
public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate()
.tileEntity("mechanical_piston", MechanicalPistonTileEntity::new)
.instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON)
.renderer(() -> MechanicalPistonRenderer::new)
.register();
public static final TileEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = Create.registrate()
public static final BlockEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = Create.registrate()
.tileEntity("windmill_bearing", WindmillBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.WINDMILL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final TileEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = Create.registrate()
public static final BlockEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = Create.registrate()
.tileEntity("mechanical_bearing", MechanicalBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.MECHANICAL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final TileEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = Create.registrate()
public static final BlockEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = Create.registrate()
.tileEntity("clockwork_bearing", ClockworkBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.CLOCKWORK_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final TileEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate()
public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate()
.tileEntity("rope_pulley", PulleyTileEntity::new)
.instance(() -> RopePulleyInstance::new)
.validBlocks(AllBlocks.ROPE_PULLEY)
.renderer(() -> PulleyRenderer::new)
.register();
public static final TileEntityEntry<ChassisTileEntity> CHASSIS = Create.registrate()
public static final BlockEntityEntry<ChassisTileEntity> CHASSIS = Create.registrate()
.tileEntity("chassis", ChassisTileEntity::new)
.validBlocks(AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS)
// .renderer(() -> renderer)
.register();
public static final TileEntityEntry<StickerTileEntity> STICKER = Create.registrate()
public static final BlockEntityEntry<StickerTileEntity> STICKER = Create.registrate()
.tileEntity("sticker", StickerTileEntity::new)
.instance(() -> StickerInstance::new)
.validBlocks(AllBlocks.STICKER)
.renderer(() -> StickerRenderer::new)
.register();
public static final TileEntityEntry<DrillTileEntity> DRILL = Create.registrate()
public static final BlockEntityEntry<DrillTileEntity> DRILL = Create.registrate()
.tileEntity("drill", DrillTileEntity::new)
.instance(() -> DrillInstance::new)
.validBlocks(AllBlocks.MECHANICAL_DRILL)
.renderer(() -> DrillRenderer::new)
.register();
public static final TileEntityEntry<SawTileEntity> SAW = Create.registrate()
public static final BlockEntityEntry<SawTileEntity> SAW = Create.registrate()
.tileEntity("saw", SawTileEntity::new)
.instance(() -> SawInstance::new)
.validBlocks(AllBlocks.MECHANICAL_SAW)
.renderer(() -> SawRenderer::new)
.register();
public static final TileEntityEntry<HarvesterTileEntity> HARVESTER = Create.registrate()
public static final BlockEntityEntry<HarvesterTileEntity> HARVESTER = Create.registrate()
.tileEntity("harvester", HarvesterTileEntity::new)
.validBlocks(AllBlocks.MECHANICAL_HARVESTER)
.renderer(() -> HarvesterRenderer::new)
.register();
public static final TileEntityEntry<PortableItemInterfaceTileEntity> PORTABLE_STORAGE_INTERFACE =
public static final BlockEntityEntry<PortableItemInterfaceTileEntity> PORTABLE_STORAGE_INTERFACE =
Create.registrate()
.tileEntity("portable_storage_interface", PortableItemInterfaceTileEntity::new)
.validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new)
.register();
public static final TileEntityEntry<PortableFluidInterfaceTileEntity> PORTABLE_FLUID_INTERFACE = Create.registrate()
public static final BlockEntityEntry<PortableFluidInterfaceTileEntity> PORTABLE_FLUID_INTERFACE = Create.registrate()
.tileEntity("portable_fluid_interface", PortableFluidInterfaceTileEntity::new)
.validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new)
.register();
public static final TileEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate()
public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate()
.tileEntity("flywheel", FlywheelTileEntity::new)
.instance(() -> FlyWheelInstance::new)
.validBlocks(AllBlocks.FLYWHEEL)
.renderer(() -> FlywheelRenderer::new)
.register();
public static final TileEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate()
public static final BlockEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate()
.tileEntity("furnace_engine", FurnaceEngineTileEntity::new)
.instance(() -> EngineInstance::new)
.validBlocks(AllBlocks.FURNACE_ENGINE)
.renderer(() -> EngineRenderer::new)
.register();
public static final TileEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate()
public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate()
.tileEntity("millstone", MillstoneTileEntity::new)
.instance(() -> MillStoneCogInstance::new)
.validBlocks(AllBlocks.MILLSTONE)
.renderer(() -> MillstoneRenderer::new)
.register();
public static final TileEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
.tileEntity("crushing_wheel", CrushingWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final TileEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER =
public static final BlockEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER =
Create.registrate()
.tileEntity("crushing_wheel_controller", CrushingWheelControllerTileEntity::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL_CONTROLLER)
// .renderer(() -> renderer)
.register();
public static final TileEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
.tileEntity("water_wheel", WaterWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final TileEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = Create.registrate()
public static final BlockEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = Create.registrate()
.tileEntity("mechanical_press", MechanicalPressTileEntity::new)
.instance(() -> PressInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PRESS)
.renderer(() -> MechanicalPressRenderer::new)
.register();
public static final TileEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = Create.registrate()
public static final BlockEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = Create.registrate()
.tileEntity("mechanical_mixer", MechanicalMixerTileEntity::new)
.instance(() -> MixerInstance::new)
.validBlocks(AllBlocks.MECHANICAL_MIXER)
.renderer(() -> MechanicalMixerRenderer::new)
.register();
public static final TileEntityEntry<DeployerTileEntity> DEPLOYER = Create.registrate()
public static final BlockEntityEntry<DeployerTileEntity> DEPLOYER = Create.registrate()
.tileEntity("deployer", DeployerTileEntity::new)
.instance(() -> DeployerInstance::new)
.validBlocks(AllBlocks.DEPLOYER)
.renderer(() -> DeployerRenderer::new)
.register();
public static final TileEntityEntry<BasinTileEntity> BASIN = Create.registrate()
public static final BlockEntityEntry<BasinTileEntity> BASIN = Create.registrate()
.tileEntity("basin", BasinTileEntity::new)
.validBlocks(AllBlocks.BASIN)
.renderer(() -> BasinRenderer::new)
.register();
public static final TileEntityEntry<BlazeBurnerTileEntity> HEATER = Create.registrate()
public static final BlockEntityEntry<BlazeBurnerTileEntity> HEATER = Create.registrate()
.tileEntity("blaze_heater", BlazeBurnerTileEntity::new)
.validBlocks(AllBlocks.BLAZE_BURNER)
.renderer(() -> BlazeBurnerRenderer::new)
.register();
public static final TileEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = Create.registrate()
public static final BlockEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = Create.registrate()
.tileEntity("mechanical_crafter", MechanicalCrafterTileEntity::new)
.instance(() -> MechanicalCrafterInstance::new)
.validBlocks(AllBlocks.MECHANICAL_CRAFTER)
.renderer(() -> MechanicalCrafterRenderer::new)
.register();
public static final TileEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate()
public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate()
.tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.SEQUENCED_GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final TileEntityEntry<SpeedControllerTileEntity> ROTATION_SPEED_CONTROLLER = Create.registrate()
public static final BlockEntityEntry<SpeedControllerTileEntity> ROTATION_SPEED_CONTROLLER = Create.registrate()
.tileEntity("rotation_speed_controller", SpeedControllerTileEntity::new)
.instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ROTATION_SPEED_CONTROLLER)
.renderer(() -> SpeedControllerRenderer::new)
.register();
public static final TileEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = Create.registrate()
public static final BlockEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = Create.registrate()
.tileEntity("speedometer", SpeedGaugeTileEntity::new)
.instance(() -> GaugeInstance.Speed::new)
.validBlocks(AllBlocks.SPEEDOMETER)
.renderer(() -> GaugeRenderer::speed)
.register();
public static final TileEntityEntry<StressGaugeTileEntity> STRESSOMETER = Create.registrate()
public static final BlockEntityEntry<StressGaugeTileEntity> STRESSOMETER = Create.registrate()
.tileEntity("stressometer", StressGaugeTileEntity::new)
.instance(() -> GaugeInstance.Stress::new)
.validBlocks(AllBlocks.STRESSOMETER)
.renderer(() -> GaugeRenderer::stress)
.register();
public static final TileEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate()
public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate()
.tileEntity("analog_lever", AnalogLeverTileEntity::new)
.instance(() -> AnalogLeverInstance::new)
.validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new)
.register();
public static final TileEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = Create.registrate()
public static final BlockEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = Create.registrate()
.tileEntity("cart_assembler", CartAssemblerTileEntity::new)
.validBlocks(AllBlocks.CART_ASSEMBLER)
// .renderer(() -> renderer)
.register();
// Logistics
public static final TileEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = Create.registrate()
public static final BlockEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = Create.registrate()
.tileEntity("redstone_link", RedstoneLinkTileEntity::new)
.validBlocks(AllBlocks.REDSTONE_LINK)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final TileEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = Create.registrate()
public static final BlockEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = Create.registrate()
.tileEntity("nixie_tube", NixieTubeTileEntity::new)
.validBlocks(AllBlocks.ORANGE_NIXIE_TUBE)
.validBlocks(AllBlocks.NIXIE_TUBES.toArray())
.renderer(() -> NixieTubeRenderer::new)
.register();
public static final TileEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = Create.registrate()
public static final BlockEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = Create.registrate()
.tileEntity("stockpile_switch", StockpileSwitchTileEntity::new)
.validBlocks(AllBlocks.STOCKPILE_SWITCH)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final TileEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = Create.registrate()
public static final BlockEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = Create.registrate()
.tileEntity("creative_crate", CreativeCrateTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_CRATE)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final TileEntityEntry<DepotTileEntity> DEPOT = Create.registrate()
public static final BlockEntityEntry<DepotTileEntity> DEPOT = Create.registrate()
.tileEntity("depot", DepotTileEntity::new)
.validBlocks(AllBlocks.DEPOT)
.renderer(() -> DepotRenderer::new)
.register();
public static final TileEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = Create.registrate()
public static final BlockEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = Create.registrate()
.tileEntity("weighted_ejector", EjectorTileEntity::new)
.instance(() -> EjectorInstance::new)
.validBlocks(AllBlocks.WEIGHTED_EJECTOR)
.renderer(() -> EjectorRenderer::new)
.register();
public static final TileEntityEntry<FunnelTileEntity> FUNNEL = Create.registrate()
public static final BlockEntityEntry<FunnelTileEntity> FUNNEL = Create.registrate()
.tileEntity("funnel", FunnelTileEntity::new)
.instance(() -> FunnelInstance::new)
.validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL,
@ -664,20 +664,20 @@ public class AllTileEntities {
.renderer(() -> FunnelRenderer::new)
.register();
public static final TileEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = Create.registrate()
public static final BlockEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = Create.registrate()
.tileEntity("content_observer", ContentObserverTileEntity::new)
.validBlocks(AllBlocks.CONTENT_OBSERVER)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final TileEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate()
public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate()
.tileEntity("adjustable_repeater", PulseExtenderTileEntity::new)
.instance(() -> BrassDiodeInstance::new)
.validBlocks(AllBlocks.PULSE_EXTENDER)
.renderer(() -> BrassDiodeRenderer::new)
.register();
public static final TileEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER =
public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER =
Create.registrate()
.tileEntity("adjustable_pulse_repeater", PulseRepeaterTileEntity::new)
.instance(() -> BrassDiodeInstance::new)
@ -685,7 +685,7 @@ public class AllTileEntities {
.renderer(() -> BrassDiodeRenderer::new)
.register();
public static final TileEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER =
public static final BlockEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER =
Create.registrate()
.tileEntity("lectern_controller", LecternControllerTileEntity::new)
.validBlocks(AllBlocks.LECTERN_CONTROLLER)
@ -693,26 +693,26 @@ public class AllTileEntities {
.register();
// Curiosities
public static final TileEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = Create.registrate()
public static final BlockEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = Create.registrate()
.tileEntity("copper_backtank", CopperBacktankTileEntity::new)
.instance(() -> CopperBacktankInstance::new)
.validBlocks(AllBlocks.COPPER_BACKTANK)
.renderer(() -> CopperBacktankRenderer::new)
.register();
public static final TileEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = Create.registrate()
public static final BlockEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = Create.registrate()
.tileEntity("peculiar_bell", PeculiarBellTileEntity::new)
.validBlocks(AllBlocks.PECULIAR_BELL)
.renderer(() -> BellRenderer::new)
.register();
public static final TileEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = Create.registrate()
public static final BlockEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = Create.registrate()
.tileEntity("cursed_bell", HauntedBellTileEntity::new)
.validBlocks(AllBlocks.HAUNTED_BELL)
.renderer(() -> BellRenderer::new)
.register();
public static final TileEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate()
public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate()
.tileEntity("toolbox", ToolboxTileEntity::new)
.instance(() -> ToolBoxInstance::new)
.validBlocks(AllBlocks.TOOLBOXES.toArray())

View file

@ -21,7 +21,6 @@ import com.simibubi.create.content.schematics.filtering.SchematicInstances;
import com.simibubi.create.foundation.advancement.AllAdvancements;
import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.block.CopperRegistries;
import com.simibubi.create.foundation.command.ChunkUtil;
import com.simibubi.create.foundation.command.ServerLagger;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.data.CreateRegistrate;
@ -42,7 +41,6 @@ import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.placement.FeatureDecorator;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.MinecraftForge;
@ -75,7 +73,6 @@ public class Create {
public static final RedstoneLinkNetworkHandler REDSTONE_LINK_NETWORK_HANDLER = new RedstoneLinkNetworkHandler();
public static final TorquePropagator TORQUE_PROPAGATOR = new TorquePropagator();
public static final ServerLagger LAGGER = new ServerLagger();
public static final ChunkUtil CHUNK_UTIL = new ChunkUtil();
public static final Random RANDOM = new Random();
private static final NonNullLazyValue<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(ID);
@ -115,13 +112,10 @@ public class Create {
modEventBus.addListener(Create::init);
modEventBus.addListener(EventPriority.LOWEST, Create::gatherData);
modEventBus.addGenericListener(Feature.class, AllWorldFeatures::registerOreFeatures);
modEventBus.addGenericListener(FeatureDecorator.class, AllWorldFeatures::registerDecoratorFeatures);
modEventBus.addGenericListener(RecipeSerializer.class, AllRecipeTypes::register);
modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register);
modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register);
forgeEventBus.register(CHUNK_UTIL);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
() -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus));
}
@ -131,13 +125,13 @@ public class Create {
SchematicInstances.register();
BuiltinPotatoProjectileTypes.register();
CHUNK_UTIL.init();
ShippedResourcePacks.extractFiles("Copper Legacy Pack");
event.enqueueWork(() -> {
AllTriggers.register();
SchematicProcessor.register();
AllWorldFeatures.registerFeatures();
AllWorldFeatures.registerPlacementTypes();
});
}

View file

@ -17,8 +17,8 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.network.NetworkHooks;
public class SeatEntity extends Entity implements IEntityAdditionalSpawnData {

View file

@ -164,8 +164,7 @@ public class CrushingWheelControllerBlock extends DirectionalBlock implements IT
return standardShape;
if (!(context instanceof EntityCollisionContext))
return standardShape;
Entity entity = ((EntityCollisionContext) context).getEntity()
.orElse(null);
Entity entity = ((EntityCollisionContext) context).getEntity();
if (entity == null)
return standardShape;

View file

@ -374,7 +374,7 @@ public class DeployerHandler {
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 35);
world.setBlock(posUp, Blocks.AIR.defaultBlockState(), 35);
} else {
if (!blockstate.removedByPlayer(world, pos, player, canHarvest, world.getFluidState(pos)))
if (!blockstate.onDestroyedByPlayer(world, pos, player, canHarvest, world.getFluidState(pos)))
return true;
}

View file

@ -136,7 +136,7 @@ public class DeployerMovementBehaviour extends MovementBehaviour {
if (AllBlockTags.SAFE_NBT.matches(blockState)) {
BlockEntity tile = schematicWorld.getBlockEntity(pos);
if (tile != null) {
data = tile.save(new CompoundTag());
data = tile.saveWithFullMetadata();
data = NBTProcessors.process(tile, data, true);
}
}

View file

@ -33,8 +33,8 @@ public class MechanicalMixerBlock extends KineticBlock implements ITE<Mechanical
@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
if (context instanceof EntityCollisionContext && ((EntityCollisionContext) context).getEntity()
.orElse(null) instanceof Player)
if (context instanceof EntityCollisionContext
&& ((EntityCollisionContext) context).getEntity() instanceof Player)
return AllShapes.CASING_14PX.get(Direction.DOWN);
return AllShapes.MECHANICAL_PROCESSOR_SHAPE;

View file

@ -28,8 +28,8 @@ public class MechanicalPressBlock extends HorizontalKineticBlock implements ITE<
@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
if (context instanceof EntityCollisionContext && ((EntityCollisionContext) context).getEntity()
.orElse(null) instanceof Player)
if (context instanceof EntityCollisionContext
&& ((EntityCollisionContext) context).getEntity() instanceof Player)
return AllShapes.CASING_14PX.get(Direction.DOWN);
return AllShapes.MECHANICAL_PROCESSOR_SHAPE;

View file

@ -51,10 +51,10 @@ import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
public abstract class AbstractContraptionEntity extends Entity implements IEntityAdditionalSpawnData {

View file

@ -607,13 +607,11 @@ public abstract class Contraption {
blockstate = blockstate.setValue(RedstoneContactBlock.POWERED, true);
if (blockstate.getBlock() instanceof ButtonBlock) {
blockstate = blockstate.setValue(ButtonBlock.POWERED, false);
world.getBlockTicks()
.scheduleTick(pos, blockstate.getBlock(), -1);
world.scheduleTick(pos, blockstate.getBlock(), -1);
}
if (blockstate.getBlock() instanceof PressurePlateBlock) {
blockstate = blockstate.setValue(PressurePlateBlock.POWERED, false);
world.getBlockTicks()
.scheduleTick(pos, blockstate.getBlock(), -1);
world.scheduleTick(pos, blockstate.getBlock(), -1);
}
CompoundTag compoundnbt = getTileEntityNBT(world, pos);
BlockEntity tileentity = world.getBlockEntity(pos);
@ -650,7 +648,7 @@ public abstract class Contraption {
BlockEntity tileentity = world.getBlockEntity(pos);
if (tileentity == null)
return null;
CompoundTag nbt = tileentity.save(new CompoundTag());
CompoundTag nbt = tileentity.saveWithFullMetadata();
nbt.remove("x");
nbt.remove("y");
nbt.remove("z");
@ -862,7 +860,7 @@ public abstract class Contraption {
CompoundTag compound = new CompoundTag();
HashMapPalette<BlockState> palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {
throw new IllegalStateException("Palette Map index exceeded maximum");
}, NbtUtils::readBlockState, NbtUtils::writeBlockState);
});
ListTag blockList = new ListTag();
for (StructureBlockInfo block : this.blocks.values()) {
@ -876,7 +874,9 @@ public abstract class Contraption {
}
ListTag paletteNBT = new ListTag();
palette.write(paletteNBT);
for(int i = 0; i < palette.getSize(); ++i)
paletteNBT.add(NbtUtils.writeBlockState(palette.values.byId(i)));
compound.put("Palette", paletteNBT);
compound.put("BlockList", blockList);
@ -890,8 +890,12 @@ public abstract class Contraption {
CompoundTag c = ((CompoundTag) compound);
palette = new HashMapPalette<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {
throw new IllegalStateException("Palette Map index exceeded maximum");
}, NbtUtils::readBlockState, NbtUtils::writeBlockState);
palette.read(c.getList("Palette", 10));
});
ListTag list = c.getList("Palette", 10);
palette.values.clear();
for (int i = 0; i < list.size(); ++i)
palette.values.add(NbtUtils.readBlockState(list.getCompound(i)));
blockList = c.getList("BlockList", 10);
} else {

View file

@ -1,10 +1,9 @@
package com.simibubi.create.content.contraptions.components.structureMovement;
import static net.minecraft.world.entity.Entity.collideBoundingBoxHeuristically;
import static net.minecraft.world.entity.Entity.collideBoundingBox;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.commons.lang3.mutable.MutableFloat;
@ -34,7 +33,6 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.util.RewindableStream;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
@ -44,9 +42,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -121,11 +116,10 @@ public class ContraptionCollider {
// Else find 'nearby' individual block shapes to collide with
List<AABB> bbs = new ArrayList<>();
RewindableStream<VoxelShape> potentialHits =
List<VoxelShape> potentialHits =
getPotentiallyCollidedShapes(world, contraption, localBB.expandTowards(motionCopy));
potentialHits.getStream()
.forEach(shape -> shape.toAabbs()
.forEach(bbs::add));
potentialHits.forEach(shape -> shape.toAabbs()
.forEach(bbs::add));
return bbs;
});
@ -398,38 +392,29 @@ public class ContraptionCollider {
/** From Entity#collide **/
static Vec3 collide(Vec3 p_20273_, Entity e) {
AABB aabb = e.getBoundingBox();
CollisionContext collisioncontext = CollisionContext.of(e);
VoxelShape voxelshape = e.level.getWorldBorder()
.getCollisionShape();
Stream<VoxelShape> stream =
Shapes.joinIsNotEmpty(voxelshape, Shapes.create(aabb.deflate(1.0E-7D)), BooleanOp.AND) ? Stream.empty()
: Stream.of(voxelshape);
Stream<VoxelShape> stream1 = e.level.getEntityCollisions(e, aabb.expandTowards(p_20273_), (p_19949_) -> {
return true;
});
RewindableStream<VoxelShape> rewindablestream = new RewindableStream<>(Stream.concat(stream1, stream));
Vec3 vec3 = p_20273_.lengthSqr() == 0.0D ? p_20273_
: collideBoundingBoxHeuristically(e, p_20273_, aabb, e.level, collisioncontext, rewindablestream);
List<VoxelShape> list = e.level.getEntityCollisions(e, aabb.expandTowards(p_20273_));
Vec3 vec3 = p_20273_.lengthSqr() == 0.0D ? p_20273_ : collideBoundingBox(e, p_20273_, aabb, e.level, list);
boolean flag = p_20273_.x != vec3.x;
boolean flag1 = p_20273_.y != vec3.y;
boolean flag2 = p_20273_.z != vec3.z;
boolean flag3 = e.isOnGround() || flag1 && p_20273_.y < 0.0D;
if (e.maxUpStep > 0.0F && flag3 && (flag || flag2)) {
Vec3 vec31 = collideBoundingBoxHeuristically(e, new Vec3(p_20273_.x, e.maxUpStep, p_20273_.z), aabb,
e.level, collisioncontext, rewindablestream);
Vec3 vec32 = collideBoundingBoxHeuristically(e, new Vec3(0.0D, e.maxUpStep, 0.0D),
aabb.expandTowards(p_20273_.x, 0.0D, p_20273_.z), e.level, collisioncontext, rewindablestream);
if (vec32.y < e.maxUpStep) {
Vec3 vec33 = collideBoundingBoxHeuristically(e, new Vec3(p_20273_.x, 0.0D, p_20273_.z),
aabb.move(vec32), e.level, collisioncontext, rewindablestream).add(vec32);
Vec3 vec31 =
collideBoundingBox(e, new Vec3(p_20273_.x, (double) e.maxUpStep, p_20273_.z), aabb, e.level, list);
Vec3 vec32 = collideBoundingBox(e, new Vec3(0.0D, (double) e.maxUpStep, 0.0D),
aabb.expandTowards(p_20273_.x, 0.0D, p_20273_.z), e.level, list);
if (vec32.y < (double) e.maxUpStep) {
Vec3 vec33 =
collideBoundingBox(e, new Vec3(p_20273_.x, 0.0D, p_20273_.z), aabb.move(vec32), e.level, list)
.add(vec32);
if (vec33.horizontalDistanceSqr() > vec31.horizontalDistanceSqr()) {
vec31 = vec33;
}
}
if (vec31.horizontalDistanceSqr() > vec3.horizontalDistanceSqr()) {
return vec31.add(collideBoundingBoxHeuristically(e, new Vec3(0.0D, -vec31.y + p_20273_.y, 0.0D),
aabb.move(vec31), e.level, collisioncontext, rewindablestream));
return vec31.add(collideBoundingBox(e, new Vec3(0.0D, -vec31.y + p_20273_.y, 0.0D), aabb.move(vec31),
e.level, list));
}
}
@ -451,7 +436,7 @@ public class ContraptionCollider {
return entity instanceof LocalPlayer;
}
private static RewindableStream<VoxelShape> getPotentiallyCollidedShapes(Level world, Contraption contraption,
private static List<VoxelShape> getPotentiallyCollidedShapes(Level world, Contraption contraption,
AABB localBB) {
double height = localBB.getYsize();
@ -464,7 +449,7 @@ public class ContraptionCollider {
BlockPos min = new BlockPos(blockScanBB.minX, blockScanBB.minY, blockScanBB.minZ);
BlockPos max = new BlockPos(blockScanBB.maxX, blockScanBB.maxY, blockScanBB.maxZ);
RewindableStream<VoxelShape> potentialHits = new RewindableStream<>(BlockPos.betweenClosedStream(min, max)
List<VoxelShape> potentialHits = BlockPos.betweenClosedStream(min, max)
.filter(contraption.getBlocks()::containsKey)
.map(p -> {
BlockState blockState = contraption.getBlocks()
@ -474,7 +459,8 @@ public class ContraptionCollider {
VoxelShape collisionShape = blockState.getCollisionShape(world, p);
return collisionShape.move(pos.getX(), pos.getY(), pos.getZ());
})
.filter(Predicates.not(VoxelShape::isEmpty)));
.filter(Predicates.not(VoxelShape::isEmpty))
.toList();
return potentialHits;
}

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionDisassemblyPacket extends SimplePacketBase {

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionStallPacket extends SimplePacketBase {

View file

@ -18,7 +18,7 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
public class MountedFluidStorage {

View file

@ -63,7 +63,7 @@ public class MountedStorage {
return;
if (te instanceof ChestBlockEntity) {
CompoundTag tag = te.save(new CompoundTag());
CompoundTag tag = te.saveWithFullMetadata();
if (tag.contains("LootTable", 8))
return;
@ -115,7 +115,7 @@ public class MountedStorage {
return;
if (te instanceof ChestBlockEntity) {
CompoundTag tag = te.save(new CompoundTag());
CompoundTag tag = te.saveWithFullMetadata();
tag.remove("Items");
NonNullList<ItemStack> items = NonNullList.withSize(handler.getSlots(), ItemStack.EMPTY);
for (int i = 0; i < items.size(); i++)

View file

@ -171,11 +171,11 @@ public class SailBlock extends WrenchableDirectionalBlock {
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
ItemStack pickBlock = super.getPickBlock(state, target, world, pos, player);
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
ItemStack pickBlock = super.getCloneItemStack(state, target, world, pos, player);
if (pickBlock.isEmpty())
return AllBlocks.SAIL.get()
.getPickBlock(state, target, world, pos, player);
.getCloneItemStack(state, target, world, pos, player);
return pickBlock;
}

View file

@ -26,7 +26,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
public class GantryContraptionEntity extends AbstractContraptionEntity {

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class GantryContraptionUpdatePacket extends SimplePacketBase {

View file

@ -11,7 +11,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class GlueEffectPacket extends SimplePacketBase {

View file

@ -62,10 +62,10 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
public class SuperGlueEntity extends Entity
implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, IInstanceRendered {

View file

@ -29,7 +29,7 @@ import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.event.world.BlockEvent.EntityPlaceEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
@EventBusSubscriber
public class SuperGlueHandler {

View file

@ -223,8 +223,7 @@ public class CartAssemblerBlock extends BaseRailBlock
public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos,
CollisionContext context) {
if (context instanceof EntityCollisionContext) {
Entity entity = ((EntityCollisionContext) context).getEntity()
.orElse(null);
Entity entity = ((EntityCollisionContext) context).getEntity();
if (entity instanceof AbstractMinecart)
return Shapes.empty();
if (entity instanceof Player)

View file

@ -107,8 +107,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock implement
return;
if (!world.isClientSide && !world.getBlockTicks()
.willTickThisTick(pos, this))
world.getBlockTicks()
.scheduleTick(pos, this, 0);
world.scheduleTick(pos, this, 0);
}
@Override

View file

@ -51,7 +51,7 @@ public class MechanicalPistonHeadBlock extends WrenchableDirectionalBlock implem
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
return AllBlocks.PISTON_EXTENSION_POLE.asStack();
}
@ -101,9 +101,8 @@ public class MechanicalPistonHeadBlock extends WrenchableDirectionalBlock implem
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState,
LevelAccessor world, BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -150,9 +150,8 @@ public class PistonExtensionPoleBlock extends WrenchableDirectionalBlock impleme
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world, BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -107,7 +107,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE<Pulle
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
return AllBlocks.ROPE_PULLEY.asStack();
}
@ -145,9 +145,8 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE<Pulle
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState,
LevelAccessor world, BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -9,8 +9,8 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.NetworkEvent.Context;
import net.minecraftforge.network.PacketDistributor;
public class ClientMotionPacket extends SimplePacketBase {

View file

@ -10,7 +10,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionFluidPacket extends SimplePacketBase {

View file

@ -12,7 +12,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionInteractionPacket extends SimplePacketBase {

View file

@ -11,7 +11,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.client.Minecraft;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionSeatMappingPacket extends SimplePacketBase {

View file

@ -10,7 +10,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class LimbSwingUpdatePacket extends SimplePacketBase {

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class CouplingCreationPacket extends SimplePacketBase {

View file

@ -34,7 +34,7 @@ import net.minecraft.world.level.block.PoweredRailBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
/**
* Extended code for Minecarts, this allows for handling stalled carts and

View file

@ -12,7 +12,7 @@ import net.minecraft.world.entity.Entity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class MinecartControllerUpdatePacket extends SimplePacketBase {

View file

@ -154,8 +154,7 @@ public class OpenEndedPipe extends FlowSource {
if (waterlog) {
world.setBlock(outputPos, state.setValue(WATERLOGGED, false), 3);
world.getLiquidTicks()
.scheduleTick(outputPos, Fluids.WATER, 1);
world.scheduleTick(outputPos, Fluids.WATER, 1);
return stack;
}
world.setBlock(outputPos, fluidState.createLegacyBlock()
@ -212,8 +211,7 @@ public class OpenEndedPipe extends FlowSource {
if (waterlog) {
world.setBlock(outputPos, state.setValue(WATERLOGGED, true), 3);
world.getLiquidTicks()
.scheduleTick(outputPos, Fluids.WATER, 1);
world.scheduleTick(outputPos, Fluids.WATER, 1);
return true;
}

View file

@ -18,7 +18,6 @@ import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
@ -31,6 +30,7 @@ import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterloggedBlock, ICogWheel, ITE<PumpTileEntity> {
@ -71,8 +71,7 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
return;
if (!isOpenAt(state, d))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
@ -90,10 +89,8 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks()
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}
@ -115,8 +112,7 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
if (world.isClientSide)
return;
if (state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
if (isPump(state) && isPump(oldState) && state.getValue(FACING) == oldState.getValue(FACING)
.getOpposite()) {

View file

@ -23,9 +23,6 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerTickList;
import net.minecraft.world.level.TickList;
import net.minecraft.world.level.TickNextTickData;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.DoorBlock;
@ -39,6 +36,8 @@ import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.ticks.LevelTickAccess;
import net.minecraft.world.ticks.LevelTicks;
public class FluidFillingBehaviour extends FluidManipulationBehaviour {
@ -191,20 +190,10 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour {
.createLegacyBlock(), 2 | 16);
}
TickList<Fluid> pendingFluidTicks = world.getLiquidTicks();
if (pendingFluidTicks instanceof ServerTickList) {
ServerTickList<Fluid> serverTickList = (ServerTickList<Fluid>) pendingFluidTicks;
TickNextTickData<Fluid> removedEntry = null;
for (TickNextTickData<Fluid> nextTickListEntry : serverTickList.tickNextTickSet) {
if (nextTickListEntry.pos.equals(currentPos)) {
removedEntry = nextTickListEntry;
break;
}
}
if (removedEntry != null) {
serverTickList.tickNextTickSet.remove(removedEntry);
serverTickList.tickNextTickList.remove(removedEntry);
}
LevelTickAccess<Fluid> pendingFluidTicks = world.getFluidTicks();
if (pendingFluidTicks instanceof LevelTicks) {
LevelTicks<Fluid> serverTickList = (LevelTicks<Fluid>) pendingFluidTicks;
serverTickList.clearArea(new BoundingBox(currentPos));
}
affectedArea.encapsulate(BoundingBox.fromCorners(currentPos, currentPos));

View file

@ -121,9 +121,8 @@ public abstract class FluidManipulationBehaviour extends TileEntityBehaviour {
FluidState nextFluidState = world.getFluidState(pos);
if (nextFluidState.isEmpty())
return;
world.getLiquidTicks()
.scheduleTick(pos, nextFluidState.getType(), world.getRandom()
.nextInt(5));
world.scheduleTick(pos, nextFluidState.getType(), world.getRandom()
.nextInt(5));
});
}

View file

@ -12,7 +12,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class FluidSplashPacket extends SimplePacketBase {

View file

@ -1,7 +1,5 @@
package com.simibubi.create.content.contraptions.fluids.particle;
import java.util.Optional;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.serialization.Codec;
@ -10,10 +8,8 @@ import com.simibubi.create.AllParticleTypes;
import com.simibubi.create.content.contraptions.particle.ICustomParticleData;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.api.distmarker.Dist;
@ -57,29 +53,18 @@ public class FluidParticleData implements ParticleOptions, ICustomParticleData<F
.getRegistryName();
}
public static final Codec<FluidStack> FLUID_CODEC = RecordCodecBuilder.create(i -> i.group(
Registry.FLUID.fieldOf("FluidName")
.forGetter(FluidStack::getFluid),
Codec.INT.fieldOf("Amount")
.forGetter(FluidStack::getAmount),
CompoundTag.CODEC.optionalFieldOf("tag")
.forGetter((fs) -> {
return Optional.ofNullable(fs.getTag());
}))
.apply(i, (f, a, t) -> new FluidStack(f, a, t.orElse(null))));
public static final Codec<FluidParticleData> CODEC = RecordCodecBuilder.create(i -> i
.group(FLUID_CODEC.fieldOf("fluid")
.group(FluidStack.CODEC.fieldOf("fluid")
.forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.FLUID_PARTICLE.get(), fs)));
public static final Codec<FluidParticleData> BASIN_CODEC = RecordCodecBuilder.create(i -> i
.group(FLUID_CODEC.fieldOf("fluid")
.group(FluidStack.CODEC.fieldOf("fluid")
.forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.BASIN_FLUID.get(), fs)));
public static final Codec<FluidParticleData> DRIP_CODEC = RecordCodecBuilder.create(i -> i
.group(FLUID_CODEC.fieldOf("fluid")
.group(FluidStack.CODEC.fieldOf("fluid")
.forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.FLUID_DRIP.get(), fs)));

View file

@ -27,7 +27,6 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.RotatedPillarBlock;
@ -37,6 +36,7 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWithBracket, IAxisPipe {
@ -77,12 +77,11 @@ public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWith
if (world.isClientSide)
return;
if (state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
return AllBlocks.FLUID_PIPE.asStack();
}
@ -96,8 +95,7 @@ public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWith
return;
if (!isOpenAt(state, d))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
public static boolean isOpenAt(BlockState state, Direction d) {

View file

@ -30,7 +30,6 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.PipeBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
@ -39,6 +38,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.ticks.TickPriority;
public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBlockItemRequirement, ITE<FluidPipeTileEntity> {
@ -72,12 +72,11 @@ public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBloc
@Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean isMoving) {
if (!world.isClientSide && state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
return AllBlocks.FLUID_PIPE.asStack();
}
@ -90,8 +89,7 @@ public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBloc
return;
if (!state.getValue(FACING_TO_PROPERTY_MAP.get(d)))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override

View file

@ -33,7 +33,6 @@ import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.PipeBlock;
@ -47,6 +46,7 @@ import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.ticks.TickPriority;
public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock, IWrenchableWithBracket, ITE<FluidPipeTileEntity> {
@ -138,8 +138,7 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
if (world.isClientSide)
return;
if (state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
@ -151,8 +150,7 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
return;
if (!isOpenAt(state, d))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
@ -242,11 +240,9 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.getLiquidTicks()
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
if (isOpenAt(state, direction) && neighbourState.hasProperty(BlockStateProperties.WATERLOGGED))
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
return updateBlockState(state, direction, direction.getOpposite(), world, pos);
}

View file

@ -19,7 +19,6 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
@ -28,6 +27,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxisPipe, ITE<FluidValveTileEntity> {
@ -102,8 +102,7 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxi
if (world.isClientSide)
return;
if (state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
@ -115,8 +114,7 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxi
return;
if (!isOpenAt(state, d))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
public static boolean isOpenAt(BlockState state, Direction d) {

View file

@ -19,7 +19,6 @@ import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;
@ -29,6 +28,7 @@ import net.minecraft.world.level.block.state.properties.AttachFace;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
implements ITE<SmartFluidPipeTileEntity>, IAxisPipe, IWrenchable {
@ -101,8 +101,7 @@ public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
if (world.isClientSide)
return;
if (state != oldState)
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
@Override
@ -114,8 +113,7 @@ public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
return;
if (!isOpenAt(state, d))
return;
world.getBlockTicks()
.scheduleTick(pos, this, 1, TickPriority.HIGH);
world.scheduleTick(pos, this, 1, TickPriority.HIGH);
}
public static boolean isOpenAt(BlockState state, Direction d) {

View file

@ -15,6 +15,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pis
import com.simibubi.create.content.contraptions.components.structureMovement.piston.PistonExtensionPoleBlock;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.config.CClient;
import com.simibubi.create.foundation.gui.RemovedGuiUtils;
import com.simibubi.create.foundation.gui.Theme;
import com.simibubi.create.foundation.gui.element.GuiGameElement;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBox;
@ -41,7 +42,6 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraftforge.client.gui.ForgeIngameGui;
import net.minecraftforge.client.gui.IIngameOverlay;
import net.minecraftforge.fmlclient.gui.GuiUtils;
public class GoggleOverlayRenderer {
@ -195,7 +195,7 @@ public class GoggleOverlayRenderer {
colorBorderBot.scaleAlpha(fade);
}
GuiUtils.drawHoveringText(poseStack, tooltip, posX, posY, tooltipScreen.width, tooltipScreen.height, -1,
RemovedGuiUtils.drawHoveringText(poseStack, tooltip, posX, posY, tooltipScreen.width, tooltipScreen.height, -1,
colorBackground.getRGB(), colorBorderTop.getRGB(), colorBorderBot.getRGB(), mc.font);
ItemStack item = AllItems.GOGGLES.asStack();

View file

@ -167,8 +167,7 @@ public class BasinBlock extends Block implements ITE<BasinTileEntity>, IWrenchab
@Override
public VoxelShape getCollisionShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext ctx) {
if (ctx instanceof EntityCollisionContext && ((EntityCollisionContext) ctx).getEntity()
.orElse(null) instanceof ItemEntity)
if (ctx instanceof EntityCollisionContext && ((EntityCollisionContext) ctx).getEntity() instanceof ItemEntity)
return AllShapes.BASIN_COLLISION_SHAPE;
return getShape(state, reader, pos, ctx);
}

View file

@ -16,7 +16,8 @@ import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.random.WeightedRandomList;
import net.minecraft.util.random.SimpleWeightedRandomList;
import net.minecraft.util.random.WeightedEntry.Wrapper;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.EntityType;
@ -89,18 +90,22 @@ public class BlazeBurnerBlockItem extends BlockItem {
return super.useOn(context);
BaseSpawner spawner = ((SpawnerBlockEntity) te).getSpawner();
WeightedRandomList<SpawnData> spawnPotentials =
SimpleWeightedRandomList<SpawnData> spawnPotentials =
ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45443_"); // spawnPotentials
List<SpawnData> possibleSpawns = spawnPotentials.unwrap();
if (spawnPotentials.isEmpty()) {
List<SpawnData> possibleSpawns = spawnPotentials.unwrap()
.stream()
.map(Wrapper::getData)
.toList();
if (possibleSpawns.isEmpty()) {
possibleSpawns = new ArrayList<>();
possibleSpawns
.add(ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45444_")); // nextSpawnData
possibleSpawns.add(ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45444_")); // nextSpawnData
}
ResourceLocation blazeId = EntityType.BLAZE.getRegistryName();
for (SpawnData e : possibleSpawns) {
ResourceLocation spawnerEntityId = new ResourceLocation(e.getTag()
ResourceLocation spawnerEntityId = new ResourceLocation(e.entityToSpawn()
.getString("id"));
if (!spawnerEntityId.equals(blazeId))
continue;
@ -117,7 +122,8 @@ public class BlazeBurnerBlockItem extends BlockItem {
}
@Override
public InteractionResult interactLivingEntity(ItemStack heldItem, Player player, LivingEntity entity, InteractionHand hand) {
public InteractionResult interactLivingEntity(ItemStack heldItem, Player player, LivingEntity entity,
InteractionHand hand) {
if (hasCapturedBlaze())
return InteractionResult.PASS;
if (!(entity instanceof Blaze))
@ -141,7 +147,8 @@ public class BlazeBurnerBlockItem extends BlockItem {
player.setItemInHand(hand, filled);
return;
}
player.getInventory().placeItemBackInInventory(filled);
player.getInventory()
.placeItemBackInInventory(filled);
}
private void spawnCaptureEffects(Level world, Vec3 vec) {

View file

@ -71,7 +71,7 @@ public class LitBlazeBurnerBlock extends Block implements IWrenchable {
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
return AllItems.EMPTY_BLAZE_BURNER.asStack();
}

View file

@ -61,8 +61,7 @@ public class SequencedGearshiftBlock extends HorizontalAxisKineticBlock implemen
return;
if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this))
worldIn.getBlockTicks()
.scheduleTick(pos, this, 0);
worldIn.scheduleTick(pos, this, 0);
}
@Override

View file

@ -130,7 +130,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
return AllItems.BELT_CONNECTOR.asStack();
}
@ -372,16 +372,14 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
return shape;
return getTileEntityOptional(worldIn, pos).map(te -> {
if (!((EntityCollisionContext) context).getEntity()
.isPresent())
Entity entity = ((EntityCollisionContext) context).getEntity();
if (entity == null)
return shape;
BeltTileEntity controller = te.getControllerTE();
if (controller == null)
return shape;
if (controller.passengers == null
|| !controller.passengers.containsKey(((EntityCollisionContext) context).getEntity()
.get()))
if (controller.passengers == null || !controller.passengers.containsKey(entity))
return BeltShapes.getCollisionShape(state);
return shape;

View file

@ -84,10 +84,8 @@ public abstract class AbstractShaftBlock extends RotatedPillarKineticBlock
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks()
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -71,13 +71,13 @@ public class EncasedCogwheelBlock extends RotatedPillarKineticBlock
public void fillItemCategory(CreativeModeTab pTab, NonNullList<ItemStack> pItems) {}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
if (target instanceof BlockHitResult)
return ((BlockHitResult) target).getDirection()
.getAxis() != getRotationAxis(state)
? isLarge ? AllBlocks.LARGE_COGWHEEL.asStack() : AllBlocks.COGWHEEL.asStack()
: getCasing().asStack();
return super.getPickBlock(state, target, world, pos, player);
return super.getCloneItemStack(state, target, world, pos, player);
}
@Override

View file

@ -62,11 +62,11 @@ public class EncasedShaftBlock extends AbstractEncasedShaftBlock
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
if (target instanceof BlockHitResult)
return ((BlockHitResult) target).getDirection()
.getAxis() == getRotationAxis(state) ? AllBlocks.SHAFT.asStack() : getCasing().asStack();
return super.getPickBlock(state, target, world, pos, player);
return super.getCloneItemStack(state, target, world, pos, player);
}
@Override

View file

@ -11,7 +11,6 @@ import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
@ -19,6 +18,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.ticks.TickPriority;
public class GearshiftBlock extends AbstractEncasedShaftBlock implements ITE<SplitShaftTileEntity> {
@ -72,7 +72,7 @@ public class GearshiftBlock extends AbstractEncasedShaftBlock implements ITE<Spl
// Re-attach next tick
if (reAttachNextTick)
worldIn.getBlockTicks().scheduleTick(pos, this, 0, TickPriority.EXTREMELY_HIGH);
worldIn.scheduleTick(pos, this, 0, TickPriority.EXTREMELY_HIGH);
}
@Override

View file

@ -50,10 +50,10 @@ public class GearboxBlock extends RotatedPillarKineticBlock implements ITE<Gearb
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
if (state.getValue(AXIS).isVertical())
return super.getPickBlock(state, target, world, pos, player);
return super.getCloneItemStack(state, target, world, pos, player);
return new ItemStack(AllItems.VERTICAL_GEARBOX.get());
}

View file

@ -78,10 +78,8 @@ public class CopperBacktankBlock extends HorizontalKineticBlock
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState,
LevelAccessor world, BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) {
world.getLiquidTicks()
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
if (state.getValue(BlockStateProperties.WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -18,7 +18,7 @@ import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.LogicalSide;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
@EventBusSubscriber
public class HauntedBellPulser {

View file

@ -5,6 +5,7 @@ import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.google.common.collect.Streams;
import com.simibubi.create.content.curiosities.bell.SoulParticle.ExpandingPerimeterData;
import com.simibubi.create.foundation.utility.VecHelper;
@ -75,7 +76,7 @@ public class SoulPulseEffect {
}
public static boolean isDark(Level world, BlockPos at) {
return world.getBrightness(LightLayer.BLOCK, at) < 8;
return world.getBrightness(LightLayer.BLOCK, at) < 1;
}
public static boolean canSpawnSoulAt(Level world, BlockPos at, boolean ignoreLight) {
@ -83,15 +84,12 @@ public class SoulPulseEffect {
double dummyWidth = 0.2, dummyHeight = 0.75;
double w2 = dummyWidth / 2;
return world != null
&& NaturalSpawner
.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, at, dummy)
return world != null && NaturalSpawner.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, at, dummy)
&& (ignoreLight || isDark(world, at))
&& world
.getBlockCollisions(null,
&& Streams
.stream(world.getBlockCollisions(null,
new AABB(at.getX() + 0.5 - w2, at.getY(), at.getZ() + 0.5 - w2, at.getX() + 0.5 + w2,
at.getY() + dummyHeight, at.getZ() + 0.5 + w2),
(a, b) -> true)
at.getY() + dummyHeight, at.getZ() + 0.5 + w2)))
.allMatch(VoxelShape::isEmpty);
}
@ -105,7 +103,7 @@ public class SoulPulseEffect {
.distanceTo(VecHelper.getCenterOf(at)))) >= distance ? new SoulParticle.PerimeterData()
: new ExpandingPerimeterData(),
p.x + 0.5, p.y + 0.5, p.z + 0.5, 0, 0, 0);
if (world.getBrightness(LightLayer.BLOCK, at) < 8) {
if (SoulPulseEffect.isDark(world, at)) {
world.addAlwaysVisibleParticle(new SoulParticle.Data(), p.x + 0.5, p.y + 0.5, p.z + 0.5, 0, 0, 0);
world.addParticle(new SoulBaseParticle.Data(), p.x + 0.5, p.y + 0.01, p.z + 0.5, 0, 0, 0);
}

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.fmllegacy.network.NetworkEvent;
import net.minecraftforge.network.NetworkEvent;
public class SoulPulseEffectPacket extends SimplePacketBase {

View file

@ -9,7 +9,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ConfigureSymmetryWandPacket extends SimplePacketBase {

View file

@ -12,7 +12,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class SymmetryEffectPacket extends SimplePacketBase {

View file

@ -28,7 +28,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.client.event.RenderLevelLastEvent;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.event.TickEvent.ClientTickEvent;
import net.minecraftforge.event.TickEvent.Phase;
@ -82,7 +82,7 @@ public class SymmetryHandler {
@OnlyIn(Dist.CLIENT)
@SubscribeEvent
public static void render(RenderWorldLastEvent event) {
public static void render(RenderLevelLastEvent event) {
Minecraft mc = Minecraft.getInstance();
LocalPlayer player = mc.player;
@ -109,7 +109,7 @@ public class SymmetryHandler {
Camera info = mc.gameRenderer.getMainCamera();
Vec3 view = info.getPosition();
PoseStack ms = event.getMatrixStack();
PoseStack ms = event.getPoseStack();
ms.pushPose();
ms.translate(-view.x(), -view.y(), -view.z());
ms.translate(pos.getX(), pos.getY(), pos.getZ());

View file

@ -49,7 +49,7 @@ import net.minecraftforge.client.IItemRenderProperties;
import net.minecraftforge.common.util.BlockSnapshot;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
public class SymmetryWandItem extends Item {

View file

@ -41,7 +41,7 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.network.NetworkHooks;
public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWaterloggedBlock, ITE<ToolboxTileEntity> {
@ -130,8 +130,7 @@ public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWa
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(WATERLOGGED))
world.getLiquidTicks()
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state;
}

View file

@ -14,7 +14,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
import net.minecraftforge.items.ItemHandlerHelper;
public class ToolboxDisposeAllPacket extends SimplePacketBase {

View file

@ -12,7 +12,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
import net.minecraftforge.items.ItemHandlerHelper;
public class ToolboxEquipPacket extends SimplePacketBase {

View file

@ -20,7 +20,7 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
public class ToolboxHandler {

View file

@ -69,7 +69,7 @@ public class ToolboxHandlerClient {
BlockState state = level.getBlockState(pos);
if (state.getMaterial() == Material.AIR)
return false;
result = state.getPickBlock(hitResult, level, pos, player);
result = state.getCloneItemStack(hitResult, level, pos, player);
} else if (hitResult.getType() == HitResult.Type.ENTITY) {
Entity entity = ((EntityHitResult) hitResult).getEntity();

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class BlueprintAssignCompleteRecipePacket extends SimplePacketBase {

View file

@ -62,12 +62,12 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.hooks.BasicEventHooks;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.InvWrapper;
import net.minecraftforge.network.NetworkHooks;
public class BlueprintEntity extends HangingEntity
implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, ISyncPersistentData, IInteractionChecker {
@ -399,7 +399,7 @@ public class BlueprintEntity extends HangingEntity
} else {
amountCrafted += result.getCount();
result.onCraftedBy(player.level, player, 1);
BasicEventHooks.firePlayerCraftingEvent(player, result, craftingInventory);
ForgeEventFactory.firePlayerCraftingEvent(player, result, craftingInventory);
NonNullList<ItemStack> nonnulllist = level.getRecipeManager()
.getRemainingItemsFor(RecipeType.CRAFTING, craftingInventory, level);

View file

@ -28,7 +28,7 @@ import net.minecraft.world.item.crafting.Ingredient.Value;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.crafting.StackList;
import net.minecraftforge.common.crafting.MultiItemValue;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
import net.minecraftforge.items.ItemStackHandler;
@ -133,7 +133,7 @@ public class BlueprintItem extends Item {
return filterItem;
}
if (itemList instanceof StackList) {
if (itemList instanceof MultiItemValue) {
ItemStack result = AllItems.FILTER.asStack();
ItemStackHandler filterItems = FilterItem.getFilterItems(result);
int i = 0;

View file

@ -10,7 +10,7 @@ import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ExtendoGripInteractionPacket extends SimplePacketBase {

View file

@ -64,7 +64,7 @@ public class ExtendoGripRenderHandler {
if (notInOffhand && !AllItems.EXTENDO_GRIP.isIn(heldItem))
return;
PoseStack ms = event.getMatrixStack();
PoseStack ms = event.getPoseStack();
TransformStack msr = TransformStack.cast(ms);
AbstractClientPlayer abstractclientplayerentity = mc.player;
RenderSystem.setShaderTexture(0, abstractclientplayerentity.getSkinTextureLocation());
@ -99,9 +99,11 @@ public class ExtendoGripRenderHandler {
PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher()
.getRenderer(player);
if (rightHand)
playerrenderer.renderRightHand(event.getMatrixStack(), event.getBuffers(), event.getLight(), player);
playerrenderer.renderRightHand(event.getPoseStack(), event.getMultiBufferSource(),
event.getPackedLight(), player);
else
playerrenderer.renderLeftHand(event.getMatrixStack(), event.getBuffers(), event.getLight(), player);
playerrenderer.renderLeftHand(event.getPoseStack(), event.getMultiBufferSource(),
event.getPackedLight(), player);
ms.popPose();
// Render gun
@ -111,7 +113,7 @@ public class ExtendoGripRenderHandler {
TransformType transform =
rightHand ? TransformType.FIRST_PERSON_RIGHT_HAND : TransformType.FIRST_PERSON_LEFT_HAND;
firstPersonRenderer.renderItem(mc.player, notInOffhand ? heldItem : offhandItem, transform, !rightHand,
event.getMatrixStack(), event.getBuffers(), event.getLight());
event.getPoseStack(), event.getMultiBufferSource(), event.getPackedLight());
if (!notInOffhand) {
ForgeHooksClient.handleCameraTransforms(ms, mc.getItemRenderer()
@ -126,8 +128,8 @@ public class ExtendoGripRenderHandler {
ms.scale(1.25f, 1.25f, 1.25f);
}
firstPersonRenderer.renderItem(mc.player, heldItem, transform, !rightHand, event.getMatrixStack(),
event.getBuffers(), event.getLight());
firstPersonRenderer.renderItem(mc.player, heldItem, transform, !rightHand, event.getPoseStack(),
event.getMultiBufferSource(), event.getPackedLight());
}
ms.popPose();

View file

@ -33,9 +33,9 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.network.NetworkHooks;
public class PotatoProjectileEntity extends AbstractHurtingProjectile implements IEntityAdditionalSpawnData {

View file

@ -20,8 +20,8 @@ import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.NetworkEvent.Context;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.registries.IRegistryDelegate;
public class PotatoProjectileTypeManager {

View file

@ -8,7 +8,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public abstract class ConfigureZapperPacket extends SimplePacketBase {

View file

@ -11,7 +11,7 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public abstract class ShootGadgetPacket extends SimplePacketBase {

View file

@ -11,7 +11,7 @@ import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
import net.minecraftforge.network.PacketDistributor;
public class ShootableGadgetItemMethods {

View file

@ -11,7 +11,6 @@ import net.minecraft.client.renderer.ItemInHandRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.HumanoidArm;
@ -77,14 +76,13 @@ public abstract class ShootableGadgetRenderHandler {
Minecraft mc = Minecraft.getInstance();
AbstractClientPlayer player = mc.player;
TextureManager textureManager = mc.getTextureManager();
PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher()
.getRenderer(player);
ItemInHandRenderer firstPersonRenderer = mc.getItemInHandRenderer();
PoseStack ms = event.getMatrixStack();
MultiBufferSource buffer = event.getBuffers();
int light = event.getLight();
PoseStack ms = event.getPoseStack();
MultiBufferSource buffer = event.getMultiBufferSource();
int light = event.getPackedLight();
float pt = event.getPartialTicks();
boolean rightHand = event.getHand() == InteractionHand.MAIN_HAND ^ mc.player.getMainArm() == HumanoidArm.LEFT;

View file

@ -80,7 +80,7 @@ public class ZapperInteractionHandler {
CompoundTag data = null;
BlockEntity tile = player.level.getBlockEntity(pos);
if (tile != null) {
data = tile.save(new CompoundTag());
data = tile.saveWithFullMetadata();
data.remove("x");
data.remove("y");
data.remove("z");

View file

@ -34,8 +34,7 @@ public class SmartChuteBlock extends AbstractChuteBlock {
return;
if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this))
worldIn.getBlockTicks()
.scheduleTick(pos, this, 0);
worldIn.scheduleTick(pos, this, 0);
}
@Override

View file

@ -9,7 +9,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class EjectorElytraPacket extends SimplePacketBase {

View file

@ -12,7 +12,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class EjectorPlacementPacket extends SimplePacketBase {

View file

@ -10,13 +10,13 @@ import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.RedStoneWireBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.ticks.TickPriority;
public class PoweredLatchBlock extends ToggleLatchBlock {
@ -49,8 +49,7 @@ public class PoweredLatchBlock extends ToggleLatchBlock {
.willTickThisTick(pos, this))
return;
if (back != shouldBack || side != shouldSide)
worldIn.getBlockTicks()
.scheduleTick(pos, this, this.getDelay(state), tickpriority);
worldIn.scheduleTick(pos, this, this.getDelay(state), tickpriority);
}
protected boolean isPoweredOnSides(Level worldIn, BlockPos pos, BlockState state) {

View file

@ -73,8 +73,7 @@ public abstract class AbstractFunnelBlock extends Block implements ITE<FunnelTil
behaviour.onNeighborChanged(fromPos);
if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this))
worldIn.getBlockTicks()
.scheduleTick(pos, this, 0);
worldIn.scheduleTick(pos, this, 0);
}
@Override

View file

@ -80,8 +80,8 @@ public class BeltFunnelBlock extends AbstractHorizontalFunnelBlock implements IS
@Override
public VoxelShape getCollisionShape(BlockState p_220071_1_, BlockGetter p_220071_2_, BlockPos p_220071_3_,
CollisionContext p_220071_4_) {
if (p_220071_4_ instanceof EntityCollisionContext && ((EntityCollisionContext) p_220071_4_).getEntity()
.orElse(null) instanceof ItemEntity
if (p_220071_4_ instanceof EntityCollisionContext
&& ((EntityCollisionContext) p_220071_4_).getEntity() instanceof ItemEntity
&& (p_220071_1_.getValue(SHAPE) == Shape.PULLING || p_220071_1_.getValue(SHAPE) == Shape.PUSHING))
return AllShapes.FUNNEL_COLLISION.get(getFacing(p_220071_1_));
return getShape(p_220071_1_, p_220071_2_, p_220071_3_, p_220071_4_);
@ -113,7 +113,8 @@ public class BeltFunnelBlock extends AbstractHorizontalFunnelBlock implements IS
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) {
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
return parent.asStack();
}

View file

@ -138,8 +138,8 @@ public abstract class FunnelBlock extends AbstractDirectionalFunnelBlock {
@Override
public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
if (context instanceof EntityCollisionContext && ((EntityCollisionContext) context).getEntity()
.orElse(null) instanceof ItemEntity && getFacing(state).getAxis()
if (context instanceof EntityCollisionContext
&& ((EntityCollisionContext) context).getEntity() instanceof ItemEntity && getFacing(state).getAxis()
.isHorizontal())
return AllShapes.FUNNEL_COLLISION.get(getFacing(state));
return getShape(state, world, pos, context);

View file

@ -13,7 +13,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context;
import net.minecraftforge.network.NetworkEvent.Context;
public class ArmPlacementPacket extends SimplePacketBase {

View file

@ -8,9 +8,9 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.ticks.TickPriority;
public class ContactMovementBehaviour extends MovementBehaviour {
@ -53,7 +53,7 @@ public class ContactMovementBehaviour extends MovementBehaviour {
public void deactivateLastVisitedContact(MovementContext context) {
if (context.data.contains("lastContact")) {
BlockPos last = NbtUtils.readBlockPos(context.data.getCompound("lastContact"));
context.world.getBlockTicks().scheduleTick(last, AllBlocks.REDSTONE_CONTACT.get(), 1, TickPriority.NORMAL);
context.world.scheduleTick(last, AllBlocks.REDSTONE_CONTACT.get(), 1, TickPriority.NORMAL);
context.data.remove("lastContact");
}
}

View file

@ -51,8 +51,7 @@ public class ContentObserverTileEntity extends SmartTileEntity {
if (turnOffTicks > 0) {
turnOffTicks--;
if (turnOffTicks == 0)
level.getBlockTicks()
.scheduleTick(worldPosition, state.getBlock(), 1);
level.scheduleTick(worldPosition, state.getBlock(), 1);
}
if (!isActive())

View file

@ -144,12 +144,12 @@ public class NixieTubeBlock extends HorizontalDirectionalBlock
}
@Override
public ItemStack getPickBlock(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos,
Player player) {
if (color != DyeColor.ORANGE)
return AllBlocks.ORANGE_NIXIE_TUBE.get()
.getPickBlock(state, target, world, pos, player);
return super.getPickBlock(state, target, world, pos, player);
.getCloneItemStack(state, target, world, pos, player);
return super.getCloneItemStack(state, target, world, pos, player);
}
@Override
@ -171,8 +171,7 @@ public class NixieTubeBlock extends HorizontalDirectionalBlock
return;
if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this))
worldIn.getBlockTicks()
.scheduleTick(pos, this, 0);
worldIn.scheduleTick(pos, this, 0);
}
@Override

View file

@ -57,8 +57,7 @@ public class RedstoneLinkBlock extends WrenchableDirectionalBlock implements ITE
if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this))
worldIn.getBlockTicks()
.scheduleTick(pos, this, 0);
worldIn.scheduleTick(pos, this, 0);
}
@Override

Some files were not shown because too many files have changed in this diff Show more