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: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin' 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'); boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
// jozu: I use a gradle workspace with both projects. // 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' group = 'com.simibubi.create'
archivesBaseName = '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')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft { 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') accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs { runs {

View file

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

View file

@ -217,7 +217,7 @@ import net.minecraftforge.common.Tags;
public class AllBlocks { public class AllBlocks {
private static final CreateRegistrate REGISTRATE = Create.registrate() private static final CreateRegistrate REGISTRATE = Create.registrate()
.itemGroup(() -> Create.BASE_CREATIVE_TAB); .creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
// Schematics // 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.SchematicTableScreen;
import com.simibubi.create.content.schematics.block.SchematicannonContainer; import com.simibubi.create.content.schematics.block.SchematicannonContainer;
import com.simibubi.create.content.schematics.block.SchematicannonScreen; import com.simibubi.create.content.schematics.block.SchematicannonScreen;
import com.tterrag.registrate.builders.ContainerBuilder.ForgeContainerFactory; import com.tterrag.registrate.builders.MenuBuilder.ForgeMenuFactory;
import com.tterrag.registrate.builders.ContainerBuilder.ScreenFactory; import com.tterrag.registrate.builders.MenuBuilder.ScreenFactory;
import com.tterrag.registrate.util.entry.ContainerEntry; import com.tterrag.registrate.util.entry.MenuEntry;
import com.tterrag.registrate.util.nullness.NonNullSupplier; import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.Screen;
@ -25,29 +25,32 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
public class AllContainerTypes { public class AllContainerTypes {
public static final ContainerEntry<SchematicTableContainer> SCHEMATIC_TABLE = public static final MenuEntry<SchematicTableContainer> SCHEMATIC_TABLE =
register("schematic_table", SchematicTableContainer::new, () -> SchematicTableScreen::new); 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); register("schematicannon", SchematicannonContainer::new, () -> SchematicannonScreen::new);
public static final ContainerEntry<FilterContainer> FILTER = public static final MenuEntry<FilterContainer> FILTER =
register("filter", FilterContainer::new, () -> FilterScreen::new); 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); 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); 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); 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); 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) { private static <C extends AbstractContainerMenu, S extends Screen & MenuAccess<C>> MenuEntry<C> register(
return Create.registrate().container(name, factory, screenFactory).register(); String name, ForgeMenuFactory<C> factory, NonNullSupplier<ScreenFactory<C, S>> screenFactory) {
return Create.registrate()
.menu(name, factory, screenFactory)
.register();
} }
public static void register() {} public static void register() {}

View file

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

View file

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

View file

@ -31,7 +31,7 @@ import net.minecraftforge.common.Tags;
public class AllTags { public class AllTags {
private static final CreateRegistrate REGISTRATE = Create.registrate() 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, public static <T> Tag.Named<T> tag(Function<ResourceLocation, Tag.Named<T>> wrapperFactory, String namespace,
String path) { 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.SchematicannonRenderer;
import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; 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 { public class AllTileEntities {
// Schematics // Schematics
public static final TileEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = Create.registrate() public static final BlockEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = Create.registrate()
.tileEntity("schematicannon", SchematicannonTileEntity::new) .tileEntity("schematicannon", SchematicannonTileEntity::new)
.instance(() -> SchematicannonInstance::new) .instance(() -> SchematicannonInstance::new)
.validBlocks(AllBlocks.SCHEMATICANNON) .validBlocks(AllBlocks.SCHEMATICANNON)
.renderer(() -> SchematicannonRenderer::new) .renderer(() -> SchematicannonRenderer::new)
.register(); .register();
public static final TileEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = Create.registrate() public static final BlockEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = Create.registrate()
.tileEntity("schematic_table", SchematicTableTileEntity::new) .tileEntity("schematic_table", SchematicTableTileEntity::new)
.validBlocks(AllBlocks.SCHEMATIC_TABLE) .validBlocks(AllBlocks.SCHEMATIC_TABLE)
.register(); .register();
// Kinetics // Kinetics
public static final TileEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate() public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate()
.tileEntity("simple_kinetic", BracketedKineticTileEntity::new) .tileEntity("simple_kinetic", BracketedKineticTileEntity::new)
.instance(() -> BracketedKineticTileInstance::new) .instance(() -> BracketedKineticTileInstance::new)
.validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL) .validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL)
.renderer(() -> BracketedKineticTileRenderer::new) .renderer(() -> BracketedKineticTileRenderer::new)
.register(); .register();
public static final TileEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate() public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate()
.tileEntity("motor", CreativeMotorTileEntity::new) .tileEntity("motor", CreativeMotorTileEntity::new)
.instance(() -> HalfShaftInstance::new) .instance(() -> HalfShaftInstance::new)
.validBlocks(AllBlocks.CREATIVE_MOTOR) .validBlocks(AllBlocks.CREATIVE_MOTOR)
.renderer(() -> CreativeMotorRenderer::new) .renderer(() -> CreativeMotorRenderer::new)
.register(); .register();
public static final TileEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate() public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate()
.tileEntity("gearbox", GearboxTileEntity::new) .tileEntity("gearbox", GearboxTileEntity::new)
.instance(() -> GearboxInstance::new) .instance(() -> GearboxInstance::new)
.validBlocks(AllBlocks.GEARBOX) .validBlocks(AllBlocks.GEARBOX)
.renderer(() -> GearboxRenderer::new) .renderer(() -> GearboxRenderer::new)
.register(); .register();
public static final TileEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate() public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate()
.tileEntity("encased_shaft", KineticTileEntity::new) .tileEntity("encased_shaft", KineticTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE) .validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE)
.renderer(() -> ShaftRenderer::new) .renderer(() -> ShaftRenderer::new)
.register(); .register();
public static final TileEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate() public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate()
.tileEntity("encased_cogwheel", SimpleKineticTileEntity::new) .tileEntity("encased_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::small) .instance(() -> EncasedCogInstance::small)
.validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL) .validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL)
.renderer(() -> EncasedCogRenderer::small) .renderer(() -> EncasedCogRenderer::small)
.register(); .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) .tileEntity("encased_large_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::large) .instance(() -> EncasedCogInstance::large)
.validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL) .validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL)
.renderer(() -> EncasedCogRenderer::large) .renderer(() -> EncasedCogRenderer::large)
.register(); .register();
public static final TileEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate() public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate()
.tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new) .tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT) .validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.renderer(() -> ShaftRenderer::new) .renderer(() -> ShaftRenderer::new)
.register(); .register();
public static final TileEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate() public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate()
.tileEntity("encased_fan", EncasedFanTileEntity::new) .tileEntity("encased_fan", EncasedFanTileEntity::new)
.instance(() -> FanInstance::new) .instance(() -> FanInstance::new)
.validBlocks(AllBlocks.ENCASED_FAN) .validBlocks(AllBlocks.ENCASED_FAN)
.renderer(() -> EncasedFanRenderer::new) .renderer(() -> EncasedFanRenderer::new)
.register(); .register();
public static final TileEntityEntry<NozzleTileEntity> NOZZLE = Create.registrate() public static final BlockEntityEntry<NozzleTileEntity> NOZZLE = Create.registrate()
.tileEntity("nozzle", NozzleTileEntity::new) .tileEntity("nozzle", NozzleTileEntity::new)
.validBlocks(AllBlocks.NOZZLE) .validBlocks(AllBlocks.NOZZLE)
// .renderer(() -> renderer) // .renderer(() -> renderer)
.register(); .register();
public static final TileEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate() public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate()
.tileEntity("clutch", ClutchTileEntity::new) .tileEntity("clutch", ClutchTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.CLUTCH) .validBlocks(AllBlocks.CLUTCH)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .register();
public static final TileEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate() public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate()
.tileEntity("gearshift", GearshiftTileEntity::new) .tileEntity("gearshift", GearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.GEARSHIFT) .validBlocks(AllBlocks.GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .register();
public static final TileEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate() public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate()
.tileEntity("turntable", TurntableTileEntity::new) .tileEntity("turntable", TurntableTileEntity::new)
.instance(() -> SingleRotatingInstance::new) .instance(() -> SingleRotatingInstance::new)
.validBlocks(AllBlocks.TURNTABLE) .validBlocks(AllBlocks.TURNTABLE)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<HandCrankTileEntity> HAND_CRANK = Create.registrate() public static final BlockEntityEntry<HandCrankTileEntity> HAND_CRANK = Create.registrate()
.tileEntity("hand_crank", HandCrankTileEntity::new) .tileEntity("hand_crank", HandCrankTileEntity::new)
.instance(() -> HandCrankInstance::new) .instance(() -> HandCrankInstance::new)
.validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE) .validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE)
@ -280,383 +280,383 @@ public class AllTileEntities {
.renderer(() -> HandCrankRenderer::new) .renderer(() -> HandCrankRenderer::new)
.register(); .register();
public static final TileEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = Create.registrate() public static final BlockEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = Create.registrate()
.tileEntity("cuckoo_clock", CuckooClockTileEntity::new) .tileEntity("cuckoo_clock", CuckooClockTileEntity::new)
.instance(() -> HorizontalHalfShaftInstance::new) .instance(() -> HorizontalHalfShaftInstance::new)
.validBlocks(AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK) .validBlocks(AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK)
.renderer(() -> CuckooClockRenderer::new) .renderer(() -> CuckooClockRenderer::new)
.register(); .register();
public static final TileEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate() public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate()
.tileEntity("gantry_shaft", GantryShaftTileEntity::new) .tileEntity("gantry_shaft", GantryShaftTileEntity::new)
.instance(() -> SingleRotatingInstance::new) .instance(() -> SingleRotatingInstance::new)
.validBlocks(AllBlocks.GANTRY_SHAFT) .validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = Create.registrate() public static final BlockEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = Create.registrate()
.tileEntity("gantry_pinion", GantryCarriageTileEntity::new) .tileEntity("gantry_pinion", GantryCarriageTileEntity::new)
.instance(() -> GantryCarriageInstance::new) .instance(() -> GantryCarriageInstance::new)
.validBlocks(AllBlocks.GANTRY_CARRIAGE) .validBlocks(AllBlocks.GANTRY_CARRIAGE)
.renderer(() -> GantryCarriageRenderer::new) .renderer(() -> GantryCarriageRenderer::new)
.register(); .register();
public static final TileEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate() public static final BlockEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
.tileEntity("mechanical_pump", PumpTileEntity::new) .tileEntity("mechanical_pump", PumpTileEntity::new)
.instance(() -> PumpCogInstance::new) .instance(() -> PumpCogInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PUMP) .validBlocks(AllBlocks.MECHANICAL_PUMP)
.renderer(() -> PumpRenderer::new) .renderer(() -> PumpRenderer::new)
.register(); .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) .tileEntity("smart_fluid_pipe", SmartFluidPipeTileEntity::new)
.validBlocks(AllBlocks.SMART_FLUID_PIPE) .validBlocks(AllBlocks.SMART_FLUID_PIPE)
.renderer(() -> SmartTileEntityRenderer::new) .renderer(() -> SmartTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<FluidPipeTileEntity> FLUID_PIPE = Create.registrate() public static final BlockEntityEntry<FluidPipeTileEntity> FLUID_PIPE = Create.registrate()
.tileEntity("fluid_pipe", FluidPipeTileEntity::new) .tileEntity("fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.FLUID_PIPE) .validBlocks(AllBlocks.FLUID_PIPE)
.register(); .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) .tileEntity("encased_fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.ENCASED_FLUID_PIPE) .validBlocks(AllBlocks.ENCASED_FLUID_PIPE)
.register(); .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) .tileEntity("glass_fluid_pipe", StraightPipeTileEntity::new)
.validBlocks(AllBlocks.GLASS_FLUID_PIPE) .validBlocks(AllBlocks.GLASS_FLUID_PIPE)
.renderer(() -> TransparentStraightPipeRenderer::new) .renderer(() -> TransparentStraightPipeRenderer::new)
.register(); .register();
public static final TileEntityEntry<FluidValveTileEntity> FLUID_VALVE = Create.registrate() public static final BlockEntityEntry<FluidValveTileEntity> FLUID_VALVE = Create.registrate()
.tileEntity("fluid_valve", FluidValveTileEntity::new) .tileEntity("fluid_valve", FluidValveTileEntity::new)
.instance(() -> FluidValveInstance::new) .instance(() -> FluidValveInstance::new)
.validBlocks(AllBlocks.FLUID_VALVE) .validBlocks(AllBlocks.FLUID_VALVE)
.renderer(() -> FluidValveRenderer::new) .renderer(() -> FluidValveRenderer::new)
.register(); .register();
public static final TileEntityEntry<FluidTankTileEntity> FLUID_TANK = Create.registrate() public static final BlockEntityEntry<FluidTankTileEntity> FLUID_TANK = Create.registrate()
.tileEntity("fluid_tank", FluidTankTileEntity::new) .tileEntity("fluid_tank", FluidTankTileEntity::new)
.validBlocks(AllBlocks.FLUID_TANK) .validBlocks(AllBlocks.FLUID_TANK)
.renderer(() -> FluidTankRenderer::new) .renderer(() -> FluidTankRenderer::new)
.register(); .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) .tileEntity("creative_fluid_tank", CreativeFluidTankTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_FLUID_TANK) .validBlocks(AllBlocks.CREATIVE_FLUID_TANK)
.renderer(() -> FluidTankRenderer::new) .renderer(() -> FluidTankRenderer::new)
.register(); .register();
public static final TileEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = Create.registrate() public static final BlockEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = Create.registrate()
.tileEntity("hose_pulley", HosePulleyTileEntity::new) .tileEntity("hose_pulley", HosePulleyTileEntity::new)
.instance(() -> HosePulleyInstance::new) .instance(() -> HosePulleyInstance::new)
.validBlocks(AllBlocks.HOSE_PULLEY) .validBlocks(AllBlocks.HOSE_PULLEY)
.renderer(() -> HosePulleyRenderer::new) .renderer(() -> HosePulleyRenderer::new)
.register(); .register();
public static final TileEntityEntry<SpoutTileEntity> SPOUT = Create.registrate() public static final BlockEntityEntry<SpoutTileEntity> SPOUT = Create.registrate()
.tileEntity("spout", SpoutTileEntity::new) .tileEntity("spout", SpoutTileEntity::new)
.validBlocks(AllBlocks.SPOUT) .validBlocks(AllBlocks.SPOUT)
.renderer(() -> SpoutRenderer::new) .renderer(() -> SpoutRenderer::new)
.register(); .register();
public static final TileEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = Create.registrate() public static final BlockEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = Create.registrate()
.tileEntity("item_drain", ItemDrainTileEntity::new) .tileEntity("item_drain", ItemDrainTileEntity::new)
.validBlocks(AllBlocks.ITEM_DRAIN) .validBlocks(AllBlocks.ITEM_DRAIN)
.renderer(() -> ItemDrainRenderer::new) .renderer(() -> ItemDrainRenderer::new)
.register(); .register();
public static final TileEntityEntry<BeltTileEntity> BELT = Create.registrate() public static final BlockEntityEntry<BeltTileEntity> BELT = Create.registrate()
.tileEntity("belt", BeltTileEntity::new) .tileEntity("belt", BeltTileEntity::new)
.instance(() -> BeltInstance::new) .instance(() -> BeltInstance::new)
.validBlocks(AllBlocks.BELT) .validBlocks(AllBlocks.BELT)
.renderer(() -> BeltRenderer::new) .renderer(() -> BeltRenderer::new)
.register(); .register();
public static final TileEntityEntry<ChuteTileEntity> CHUTE = Create.registrate() public static final BlockEntityEntry<ChuteTileEntity> CHUTE = Create.registrate()
.tileEntity("chute", ChuteTileEntity::new) .tileEntity("chute", ChuteTileEntity::new)
.validBlocks(AllBlocks.CHUTE) .validBlocks(AllBlocks.CHUTE)
.renderer(() -> ChuteRenderer::new) .renderer(() -> ChuteRenderer::new)
.register(); .register();
public static final TileEntityEntry<SmartChuteTileEntity> SMART_CHUTE = Create.registrate() public static final BlockEntityEntry<SmartChuteTileEntity> SMART_CHUTE = Create.registrate()
.tileEntity("smart_chute", SmartChuteTileEntity::new) .tileEntity("smart_chute", SmartChuteTileEntity::new)
.validBlocks(AllBlocks.SMART_CHUTE) .validBlocks(AllBlocks.SMART_CHUTE)
.renderer(() -> SmartChuteRenderer::new) .renderer(() -> SmartChuteRenderer::new)
.register(); .register();
public static final TileEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = Create.registrate() public static final BlockEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = Create.registrate()
.tileEntity("andesite_tunnel", BeltTunnelTileEntity::new) .tileEntity("andesite_tunnel", BeltTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new) .instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.ANDESITE_TUNNEL) .validBlocks(AllBlocks.ANDESITE_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new) .renderer(() -> BeltTunnelRenderer::new)
.register(); .register();
public static final TileEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = Create.registrate() public static final BlockEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = Create.registrate()
.tileEntity("brass_tunnel", BrassTunnelTileEntity::new) .tileEntity("brass_tunnel", BrassTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new) .instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.BRASS_TUNNEL) .validBlocks(AllBlocks.BRASS_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new) .renderer(() -> BeltTunnelRenderer::new)
.register(); .register();
public static final TileEntityEntry<ArmTileEntity> MECHANICAL_ARM = Create.registrate() public static final BlockEntityEntry<ArmTileEntity> MECHANICAL_ARM = Create.registrate()
.tileEntity("mechanical_arm", ArmTileEntity::new) .tileEntity("mechanical_arm", ArmTileEntity::new)
.instance(() -> ArmInstance::new) .instance(() -> ArmInstance::new)
.validBlocks(AllBlocks.MECHANICAL_ARM) .validBlocks(AllBlocks.MECHANICAL_ARM)
.renderer(() -> ArmRenderer::new) .renderer(() -> ArmRenderer::new)
.register(); .register();
public static final TileEntityEntry<ItemVaultTileEntity> ITEM_VAULT = Create.registrate() public static final BlockEntityEntry<ItemVaultTileEntity> ITEM_VAULT = Create.registrate()
.tileEntity("item_vault", ItemVaultTileEntity::new) .tileEntity("item_vault", ItemVaultTileEntity::new)
.validBlocks(AllBlocks.ITEM_VAULT) .validBlocks(AllBlocks.ITEM_VAULT)
.register(); .register();
public static final TileEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate() public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate()
.tileEntity("mechanical_piston", MechanicalPistonTileEntity::new) .tileEntity("mechanical_piston", MechanicalPistonTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON) .validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON)
.renderer(() -> MechanicalPistonRenderer::new) .renderer(() -> MechanicalPistonRenderer::new)
.register(); .register();
public static final TileEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = Create.registrate() public static final BlockEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = Create.registrate()
.tileEntity("windmill_bearing", WindmillBearingTileEntity::new) .tileEntity("windmill_bearing", WindmillBearingTileEntity::new)
.instance(() -> BearingInstance::new) .instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.WINDMILL_BEARING) .validBlocks(AllBlocks.WINDMILL_BEARING)
.renderer(() -> BearingRenderer::new) .renderer(() -> BearingRenderer::new)
.register(); .register();
public static final TileEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = Create.registrate() public static final BlockEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = Create.registrate()
.tileEntity("mechanical_bearing", MechanicalBearingTileEntity::new) .tileEntity("mechanical_bearing", MechanicalBearingTileEntity::new)
.instance(() -> BearingInstance::new) .instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.MECHANICAL_BEARING) .validBlocks(AllBlocks.MECHANICAL_BEARING)
.renderer(() -> BearingRenderer::new) .renderer(() -> BearingRenderer::new)
.register(); .register();
public static final TileEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = Create.registrate() public static final BlockEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = Create.registrate()
.tileEntity("clockwork_bearing", ClockworkBearingTileEntity::new) .tileEntity("clockwork_bearing", ClockworkBearingTileEntity::new)
.instance(() -> BearingInstance::new) .instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.CLOCKWORK_BEARING) .validBlocks(AllBlocks.CLOCKWORK_BEARING)
.renderer(() -> BearingRenderer::new) .renderer(() -> BearingRenderer::new)
.register(); .register();
public static final TileEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate() public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate()
.tileEntity("rope_pulley", PulleyTileEntity::new) .tileEntity("rope_pulley", PulleyTileEntity::new)
.instance(() -> RopePulleyInstance::new) .instance(() -> RopePulleyInstance::new)
.validBlocks(AllBlocks.ROPE_PULLEY) .validBlocks(AllBlocks.ROPE_PULLEY)
.renderer(() -> PulleyRenderer::new) .renderer(() -> PulleyRenderer::new)
.register(); .register();
public static final TileEntityEntry<ChassisTileEntity> CHASSIS = Create.registrate() public static final BlockEntityEntry<ChassisTileEntity> CHASSIS = Create.registrate()
.tileEntity("chassis", ChassisTileEntity::new) .tileEntity("chassis", ChassisTileEntity::new)
.validBlocks(AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS) .validBlocks(AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS)
// .renderer(() -> renderer) // .renderer(() -> renderer)
.register(); .register();
public static final TileEntityEntry<StickerTileEntity> STICKER = Create.registrate() public static final BlockEntityEntry<StickerTileEntity> STICKER = Create.registrate()
.tileEntity("sticker", StickerTileEntity::new) .tileEntity("sticker", StickerTileEntity::new)
.instance(() -> StickerInstance::new) .instance(() -> StickerInstance::new)
.validBlocks(AllBlocks.STICKER) .validBlocks(AllBlocks.STICKER)
.renderer(() -> StickerRenderer::new) .renderer(() -> StickerRenderer::new)
.register(); .register();
public static final TileEntityEntry<DrillTileEntity> DRILL = Create.registrate() public static final BlockEntityEntry<DrillTileEntity> DRILL = Create.registrate()
.tileEntity("drill", DrillTileEntity::new) .tileEntity("drill", DrillTileEntity::new)
.instance(() -> DrillInstance::new) .instance(() -> DrillInstance::new)
.validBlocks(AllBlocks.MECHANICAL_DRILL) .validBlocks(AllBlocks.MECHANICAL_DRILL)
.renderer(() -> DrillRenderer::new) .renderer(() -> DrillRenderer::new)
.register(); .register();
public static final TileEntityEntry<SawTileEntity> SAW = Create.registrate() public static final BlockEntityEntry<SawTileEntity> SAW = Create.registrate()
.tileEntity("saw", SawTileEntity::new) .tileEntity("saw", SawTileEntity::new)
.instance(() -> SawInstance::new) .instance(() -> SawInstance::new)
.validBlocks(AllBlocks.MECHANICAL_SAW) .validBlocks(AllBlocks.MECHANICAL_SAW)
.renderer(() -> SawRenderer::new) .renderer(() -> SawRenderer::new)
.register(); .register();
public static final TileEntityEntry<HarvesterTileEntity> HARVESTER = Create.registrate() public static final BlockEntityEntry<HarvesterTileEntity> HARVESTER = Create.registrate()
.tileEntity("harvester", HarvesterTileEntity::new) .tileEntity("harvester", HarvesterTileEntity::new)
.validBlocks(AllBlocks.MECHANICAL_HARVESTER) .validBlocks(AllBlocks.MECHANICAL_HARVESTER)
.renderer(() -> HarvesterRenderer::new) .renderer(() -> HarvesterRenderer::new)
.register(); .register();
public static final TileEntityEntry<PortableItemInterfaceTileEntity> PORTABLE_STORAGE_INTERFACE = public static final BlockEntityEntry<PortableItemInterfaceTileEntity> PORTABLE_STORAGE_INTERFACE =
Create.registrate() Create.registrate()
.tileEntity("portable_storage_interface", PortableItemInterfaceTileEntity::new) .tileEntity("portable_storage_interface", PortableItemInterfaceTileEntity::new)
.validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE) .validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new) .renderer(() -> PortableStorageInterfaceRenderer::new)
.register(); .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) .tileEntity("portable_fluid_interface", PortableFluidInterfaceTileEntity::new)
.validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE) .validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new) .renderer(() -> PortableStorageInterfaceRenderer::new)
.register(); .register();
public static final TileEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate() public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate()
.tileEntity("flywheel", FlywheelTileEntity::new) .tileEntity("flywheel", FlywheelTileEntity::new)
.instance(() -> FlyWheelInstance::new) .instance(() -> FlyWheelInstance::new)
.validBlocks(AllBlocks.FLYWHEEL) .validBlocks(AllBlocks.FLYWHEEL)
.renderer(() -> FlywheelRenderer::new) .renderer(() -> FlywheelRenderer::new)
.register(); .register();
public static final TileEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate() public static final BlockEntityEntry<FurnaceEngineTileEntity> FURNACE_ENGINE = Create.registrate()
.tileEntity("furnace_engine", FurnaceEngineTileEntity::new) .tileEntity("furnace_engine", FurnaceEngineTileEntity::new)
.instance(() -> EngineInstance::new) .instance(() -> EngineInstance::new)
.validBlocks(AllBlocks.FURNACE_ENGINE) .validBlocks(AllBlocks.FURNACE_ENGINE)
.renderer(() -> EngineRenderer::new) .renderer(() -> EngineRenderer::new)
.register(); .register();
public static final TileEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate() public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate()
.tileEntity("millstone", MillstoneTileEntity::new) .tileEntity("millstone", MillstoneTileEntity::new)
.instance(() -> MillStoneCogInstance::new) .instance(() -> MillStoneCogInstance::new)
.validBlocks(AllBlocks.MILLSTONE) .validBlocks(AllBlocks.MILLSTONE)
.renderer(() -> MillstoneRenderer::new) .renderer(() -> MillstoneRenderer::new)
.register(); .register();
public static final TileEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate() public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
.tileEntity("crushing_wheel", CrushingWheelTileEntity::new) .tileEntity("crushing_wheel", CrushingWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new) .instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL) .validBlocks(AllBlocks.CRUSHING_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER = public static final BlockEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER =
Create.registrate() Create.registrate()
.tileEntity("crushing_wheel_controller", CrushingWheelControllerTileEntity::new) .tileEntity("crushing_wheel_controller", CrushingWheelControllerTileEntity::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL_CONTROLLER) .validBlocks(AllBlocks.CRUSHING_WHEEL_CONTROLLER)
// .renderer(() -> renderer) // .renderer(() -> renderer)
.register(); .register();
public static final TileEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate() public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
.tileEntity("water_wheel", WaterWheelTileEntity::new) .tileEntity("water_wheel", WaterWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new) .instance(() -> CutoutRotatingInstance::new)
.validBlocks(AllBlocks.WATER_WHEEL) .validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new) .renderer(() -> KineticTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = Create.registrate() public static final BlockEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = Create.registrate()
.tileEntity("mechanical_press", MechanicalPressTileEntity::new) .tileEntity("mechanical_press", MechanicalPressTileEntity::new)
.instance(() -> PressInstance::new) .instance(() -> PressInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PRESS) .validBlocks(AllBlocks.MECHANICAL_PRESS)
.renderer(() -> MechanicalPressRenderer::new) .renderer(() -> MechanicalPressRenderer::new)
.register(); .register();
public static final TileEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = Create.registrate() public static final BlockEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = Create.registrate()
.tileEntity("mechanical_mixer", MechanicalMixerTileEntity::new) .tileEntity("mechanical_mixer", MechanicalMixerTileEntity::new)
.instance(() -> MixerInstance::new) .instance(() -> MixerInstance::new)
.validBlocks(AllBlocks.MECHANICAL_MIXER) .validBlocks(AllBlocks.MECHANICAL_MIXER)
.renderer(() -> MechanicalMixerRenderer::new) .renderer(() -> MechanicalMixerRenderer::new)
.register(); .register();
public static final TileEntityEntry<DeployerTileEntity> DEPLOYER = Create.registrate() public static final BlockEntityEntry<DeployerTileEntity> DEPLOYER = Create.registrate()
.tileEntity("deployer", DeployerTileEntity::new) .tileEntity("deployer", DeployerTileEntity::new)
.instance(() -> DeployerInstance::new) .instance(() -> DeployerInstance::new)
.validBlocks(AllBlocks.DEPLOYER) .validBlocks(AllBlocks.DEPLOYER)
.renderer(() -> DeployerRenderer::new) .renderer(() -> DeployerRenderer::new)
.register(); .register();
public static final TileEntityEntry<BasinTileEntity> BASIN = Create.registrate() public static final BlockEntityEntry<BasinTileEntity> BASIN = Create.registrate()
.tileEntity("basin", BasinTileEntity::new) .tileEntity("basin", BasinTileEntity::new)
.validBlocks(AllBlocks.BASIN) .validBlocks(AllBlocks.BASIN)
.renderer(() -> BasinRenderer::new) .renderer(() -> BasinRenderer::new)
.register(); .register();
public static final TileEntityEntry<BlazeBurnerTileEntity> HEATER = Create.registrate() public static final BlockEntityEntry<BlazeBurnerTileEntity> HEATER = Create.registrate()
.tileEntity("blaze_heater", BlazeBurnerTileEntity::new) .tileEntity("blaze_heater", BlazeBurnerTileEntity::new)
.validBlocks(AllBlocks.BLAZE_BURNER) .validBlocks(AllBlocks.BLAZE_BURNER)
.renderer(() -> BlazeBurnerRenderer::new) .renderer(() -> BlazeBurnerRenderer::new)
.register(); .register();
public static final TileEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = Create.registrate() public static final BlockEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = Create.registrate()
.tileEntity("mechanical_crafter", MechanicalCrafterTileEntity::new) .tileEntity("mechanical_crafter", MechanicalCrafterTileEntity::new)
.instance(() -> MechanicalCrafterInstance::new) .instance(() -> MechanicalCrafterInstance::new)
.validBlocks(AllBlocks.MECHANICAL_CRAFTER) .validBlocks(AllBlocks.MECHANICAL_CRAFTER)
.renderer(() -> MechanicalCrafterRenderer::new) .renderer(() -> MechanicalCrafterRenderer::new)
.register(); .register();
public static final TileEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate() public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate()
.tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new) .tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new) .instance(() -> SplitShaftInstance::new)
.validBlocks(AllBlocks.SEQUENCED_GEARSHIFT) .validBlocks(AllBlocks.SEQUENCED_GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new) .renderer(() -> SplitShaftRenderer::new)
.register(); .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) .tileEntity("rotation_speed_controller", SpeedControllerTileEntity::new)
.instance(() -> ShaftInstance::new) .instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ROTATION_SPEED_CONTROLLER) .validBlocks(AllBlocks.ROTATION_SPEED_CONTROLLER)
.renderer(() -> SpeedControllerRenderer::new) .renderer(() -> SpeedControllerRenderer::new)
.register(); .register();
public static final TileEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = Create.registrate() public static final BlockEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = Create.registrate()
.tileEntity("speedometer", SpeedGaugeTileEntity::new) .tileEntity("speedometer", SpeedGaugeTileEntity::new)
.instance(() -> GaugeInstance.Speed::new) .instance(() -> GaugeInstance.Speed::new)
.validBlocks(AllBlocks.SPEEDOMETER) .validBlocks(AllBlocks.SPEEDOMETER)
.renderer(() -> GaugeRenderer::speed) .renderer(() -> GaugeRenderer::speed)
.register(); .register();
public static final TileEntityEntry<StressGaugeTileEntity> STRESSOMETER = Create.registrate() public static final BlockEntityEntry<StressGaugeTileEntity> STRESSOMETER = Create.registrate()
.tileEntity("stressometer", StressGaugeTileEntity::new) .tileEntity("stressometer", StressGaugeTileEntity::new)
.instance(() -> GaugeInstance.Stress::new) .instance(() -> GaugeInstance.Stress::new)
.validBlocks(AllBlocks.STRESSOMETER) .validBlocks(AllBlocks.STRESSOMETER)
.renderer(() -> GaugeRenderer::stress) .renderer(() -> GaugeRenderer::stress)
.register(); .register();
public static final TileEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate() public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate()
.tileEntity("analog_lever", AnalogLeverTileEntity::new) .tileEntity("analog_lever", AnalogLeverTileEntity::new)
.instance(() -> AnalogLeverInstance::new) .instance(() -> AnalogLeverInstance::new)
.validBlocks(AllBlocks.ANALOG_LEVER) .validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new) .renderer(() -> AnalogLeverRenderer::new)
.register(); .register();
public static final TileEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = Create.registrate() public static final BlockEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = Create.registrate()
.tileEntity("cart_assembler", CartAssemblerTileEntity::new) .tileEntity("cart_assembler", CartAssemblerTileEntity::new)
.validBlocks(AllBlocks.CART_ASSEMBLER) .validBlocks(AllBlocks.CART_ASSEMBLER)
// .renderer(() -> renderer) // .renderer(() -> renderer)
.register(); .register();
// Logistics // Logistics
public static final TileEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = Create.registrate() public static final BlockEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = Create.registrate()
.tileEntity("redstone_link", RedstoneLinkTileEntity::new) .tileEntity("redstone_link", RedstoneLinkTileEntity::new)
.validBlocks(AllBlocks.REDSTONE_LINK) .validBlocks(AllBlocks.REDSTONE_LINK)
.renderer(() -> SmartTileEntityRenderer::new) .renderer(() -> SmartTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = Create.registrate() public static final BlockEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = Create.registrate()
.tileEntity("nixie_tube", NixieTubeTileEntity::new) .tileEntity("nixie_tube", NixieTubeTileEntity::new)
.validBlocks(AllBlocks.ORANGE_NIXIE_TUBE) .validBlocks(AllBlocks.ORANGE_NIXIE_TUBE)
.validBlocks(AllBlocks.NIXIE_TUBES.toArray()) .validBlocks(AllBlocks.NIXIE_TUBES.toArray())
.renderer(() -> NixieTubeRenderer::new) .renderer(() -> NixieTubeRenderer::new)
.register(); .register();
public static final TileEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = Create.registrate() public static final BlockEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = Create.registrate()
.tileEntity("stockpile_switch", StockpileSwitchTileEntity::new) .tileEntity("stockpile_switch", StockpileSwitchTileEntity::new)
.validBlocks(AllBlocks.STOCKPILE_SWITCH) .validBlocks(AllBlocks.STOCKPILE_SWITCH)
.renderer(() -> SmartTileEntityRenderer::new) .renderer(() -> SmartTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = Create.registrate() public static final BlockEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = Create.registrate()
.tileEntity("creative_crate", CreativeCrateTileEntity::new) .tileEntity("creative_crate", CreativeCrateTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_CRATE) .validBlocks(AllBlocks.CREATIVE_CRATE)
.renderer(() -> SmartTileEntityRenderer::new) .renderer(() -> SmartTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<DepotTileEntity> DEPOT = Create.registrate() public static final BlockEntityEntry<DepotTileEntity> DEPOT = Create.registrate()
.tileEntity("depot", DepotTileEntity::new) .tileEntity("depot", DepotTileEntity::new)
.validBlocks(AllBlocks.DEPOT) .validBlocks(AllBlocks.DEPOT)
.renderer(() -> DepotRenderer::new) .renderer(() -> DepotRenderer::new)
.register(); .register();
public static final TileEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = Create.registrate() public static final BlockEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = Create.registrate()
.tileEntity("weighted_ejector", EjectorTileEntity::new) .tileEntity("weighted_ejector", EjectorTileEntity::new)
.instance(() -> EjectorInstance::new) .instance(() -> EjectorInstance::new)
.validBlocks(AllBlocks.WEIGHTED_EJECTOR) .validBlocks(AllBlocks.WEIGHTED_EJECTOR)
.renderer(() -> EjectorRenderer::new) .renderer(() -> EjectorRenderer::new)
.register(); .register();
public static final TileEntityEntry<FunnelTileEntity> FUNNEL = Create.registrate() public static final BlockEntityEntry<FunnelTileEntity> FUNNEL = Create.registrate()
.tileEntity("funnel", FunnelTileEntity::new) .tileEntity("funnel", FunnelTileEntity::new)
.instance(() -> FunnelInstance::new) .instance(() -> FunnelInstance::new)
.validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL, .validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL,
@ -664,20 +664,20 @@ public class AllTileEntities {
.renderer(() -> FunnelRenderer::new) .renderer(() -> FunnelRenderer::new)
.register(); .register();
public static final TileEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = Create.registrate() public static final BlockEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = Create.registrate()
.tileEntity("content_observer", ContentObserverTileEntity::new) .tileEntity("content_observer", ContentObserverTileEntity::new)
.validBlocks(AllBlocks.CONTENT_OBSERVER) .validBlocks(AllBlocks.CONTENT_OBSERVER)
.renderer(() -> SmartTileEntityRenderer::new) .renderer(() -> SmartTileEntityRenderer::new)
.register(); .register();
public static final TileEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate() public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate()
.tileEntity("adjustable_repeater", PulseExtenderTileEntity::new) .tileEntity("adjustable_repeater", PulseExtenderTileEntity::new)
.instance(() -> BrassDiodeInstance::new) .instance(() -> BrassDiodeInstance::new)
.validBlocks(AllBlocks.PULSE_EXTENDER) .validBlocks(AllBlocks.PULSE_EXTENDER)
.renderer(() -> BrassDiodeRenderer::new) .renderer(() -> BrassDiodeRenderer::new)
.register(); .register();
public static final TileEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER = public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER =
Create.registrate() Create.registrate()
.tileEntity("adjustable_pulse_repeater", PulseRepeaterTileEntity::new) .tileEntity("adjustable_pulse_repeater", PulseRepeaterTileEntity::new)
.instance(() -> BrassDiodeInstance::new) .instance(() -> BrassDiodeInstance::new)
@ -685,7 +685,7 @@ public class AllTileEntities {
.renderer(() -> BrassDiodeRenderer::new) .renderer(() -> BrassDiodeRenderer::new)
.register(); .register();
public static final TileEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER = public static final BlockEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER =
Create.registrate() Create.registrate()
.tileEntity("lectern_controller", LecternControllerTileEntity::new) .tileEntity("lectern_controller", LecternControllerTileEntity::new)
.validBlocks(AllBlocks.LECTERN_CONTROLLER) .validBlocks(AllBlocks.LECTERN_CONTROLLER)
@ -693,26 +693,26 @@ public class AllTileEntities {
.register(); .register();
// Curiosities // Curiosities
public static final TileEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = Create.registrate() public static final BlockEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = Create.registrate()
.tileEntity("copper_backtank", CopperBacktankTileEntity::new) .tileEntity("copper_backtank", CopperBacktankTileEntity::new)
.instance(() -> CopperBacktankInstance::new) .instance(() -> CopperBacktankInstance::new)
.validBlocks(AllBlocks.COPPER_BACKTANK) .validBlocks(AllBlocks.COPPER_BACKTANK)
.renderer(() -> CopperBacktankRenderer::new) .renderer(() -> CopperBacktankRenderer::new)
.register(); .register();
public static final TileEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = Create.registrate() public static final BlockEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = Create.registrate()
.tileEntity("peculiar_bell", PeculiarBellTileEntity::new) .tileEntity("peculiar_bell", PeculiarBellTileEntity::new)
.validBlocks(AllBlocks.PECULIAR_BELL) .validBlocks(AllBlocks.PECULIAR_BELL)
.renderer(() -> BellRenderer::new) .renderer(() -> BellRenderer::new)
.register(); .register();
public static final TileEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = Create.registrate() public static final BlockEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = Create.registrate()
.tileEntity("cursed_bell", HauntedBellTileEntity::new) .tileEntity("cursed_bell", HauntedBellTileEntity::new)
.validBlocks(AllBlocks.HAUNTED_BELL) .validBlocks(AllBlocks.HAUNTED_BELL)
.renderer(() -> BellRenderer::new) .renderer(() -> BellRenderer::new)
.register(); .register();
public static final TileEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate() public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate()
.tileEntity("toolbox", ToolboxTileEntity::new) .tileEntity("toolbox", ToolboxTileEntity::new)
.instance(() -> ToolBoxInstance::new) .instance(() -> ToolBoxInstance::new)
.validBlocks(AllBlocks.TOOLBOXES.toArray()) .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.AllAdvancements;
import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.block.CopperRegistries; 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.command.ServerLagger;
import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.data.CreateRegistrate; 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.CreativeModeTab;
import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.levelgen.feature.Feature; 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.api.distmarker.Dist;
import net.minecraftforge.common.ForgeMod; import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.MinecraftForge; 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 RedstoneLinkNetworkHandler REDSTONE_LINK_NETWORK_HANDLER = new RedstoneLinkNetworkHandler();
public static final TorquePropagator TORQUE_PROPAGATOR = new TorquePropagator(); public static final TorquePropagator TORQUE_PROPAGATOR = new TorquePropagator();
public static final ServerLagger LAGGER = new ServerLagger(); public static final ServerLagger LAGGER = new ServerLagger();
public static final ChunkUtil CHUNK_UTIL = new ChunkUtil();
public static final Random RANDOM = new Random(); public static final Random RANDOM = new Random();
private static final NonNullLazyValue<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(ID); private static final NonNullLazyValue<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(ID);
@ -115,13 +112,10 @@ public class Create {
modEventBus.addListener(Create::init); modEventBus.addListener(Create::init);
modEventBus.addListener(EventPriority.LOWEST, Create::gatherData); modEventBus.addListener(EventPriority.LOWEST, Create::gatherData);
modEventBus.addGenericListener(Feature.class, AllWorldFeatures::registerOreFeatures); modEventBus.addGenericListener(Feature.class, AllWorldFeatures::registerOreFeatures);
modEventBus.addGenericListener(FeatureDecorator.class, AllWorldFeatures::registerDecoratorFeatures);
modEventBus.addGenericListener(RecipeSerializer.class, AllRecipeTypes::register); modEventBus.addGenericListener(RecipeSerializer.class, AllRecipeTypes::register);
modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register); modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register);
modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register); modEventBus.addGenericListener(SoundEvent.class, AllSoundEvents::register);
forgeEventBus.register(CHUNK_UTIL);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
() -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus)); () -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus));
} }
@ -131,13 +125,13 @@ public class Create {
SchematicInstances.register(); SchematicInstances.register();
BuiltinPotatoProjectileTypes.register(); BuiltinPotatoProjectileTypes.register();
CHUNK_UTIL.init();
ShippedResourcePacks.extractFiles("Copper Legacy Pack"); ShippedResourcePacks.extractFiles("Copper Legacy Pack");
event.enqueueWork(() -> { event.enqueueWork(() -> {
AllTriggers.register(); AllTriggers.register();
SchematicProcessor.register(); SchematicProcessor.register();
AllWorldFeatures.registerFeatures(); 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.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks; import net.minecraftforge.network.NetworkHooks;
public class SeatEntity extends Entity implements IEntityAdditionalSpawnData { public class SeatEntity extends Entity implements IEntityAdditionalSpawnData {

View file

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

View file

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

View file

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

View file

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

View file

@ -28,8 +28,8 @@ public class MechanicalPressBlock extends HorizontalKineticBlock implements ITE<
@Override @Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
if (context instanceof EntityCollisionContext && ((EntityCollisionContext) context).getEntity() if (context instanceof EntityCollisionContext
.orElse(null) instanceof Player) && ((EntityCollisionContext) context).getEntity() instanceof Player)
return AllShapes.CASING_14PX.get(Direction.DOWN); return AllShapes.CASING_14PX.get(Direction.DOWN);
return AllShapes.MECHANICAL_PROCESSOR_SHAPE; 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.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper; import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.fmllegacy.network.NetworkHooks; import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
public abstract class AbstractContraptionEntity extends Entity implements IEntityAdditionalSpawnData { public abstract class AbstractContraptionEntity extends Entity implements IEntityAdditionalSpawnData {

View file

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

View file

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

View file

@ -7,7 +7,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionDisassemblyPacket extends SimplePacketBase { 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.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionStallPacket extends SimplePacketBase { 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.IFluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class MountedFluidStorage { public class MountedFluidStorage {

View file

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

View file

@ -171,11 +171,11 @@ public class SailBlock extends WrenchableDirectionalBlock {
} }
@Override @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) {
ItemStack pickBlock = super.getPickBlock(state, target, world, pos, player); ItemStack pickBlock = super.getCloneItemStack(state, target, world, pos, player);
if (pickBlock.isEmpty()) if (pickBlock.isEmpty())
return AllBlocks.SAIL.get() return AllBlocks.SAIL.get()
.getPickBlock(state, target, world, pos, player); .getCloneItemStack(state, target, world, pos, player);
return pickBlock; return pickBlock;
} }

View file

@ -26,7 +26,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class GantryContraptionEntity extends AbstractContraptionEntity { 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.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class GantryContraptionUpdatePacket extends SimplePacketBase { 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.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class GlueEffectPacket extends SimplePacketBase { 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.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.fmllegacy.network.NetworkHooks; import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.fmllegacy.network.PacketDistributor;
public class SuperGlueEntity extends Entity public class SuperGlueEntity extends Entity
implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, IInstanceRendered { 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.event.world.BlockEvent.EntityPlaceEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
@EventBusSubscriber @EventBusSubscriber
public class SuperGlueHandler { 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, public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos,
CollisionContext context) { CollisionContext context) {
if (context instanceof EntityCollisionContext) { if (context instanceof EntityCollisionContext) {
Entity entity = ((EntityCollisionContext) context).getEntity() Entity entity = ((EntityCollisionContext) context).getEntity();
.orElse(null);
if (entity instanceof AbstractMinecart) if (entity instanceof AbstractMinecart)
return Shapes.empty(); return Shapes.empty();
if (entity instanceof Player) if (entity instanceof Player)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,7 +10,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionFluidPacket extends SimplePacketBase { 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.InteractionHand;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraftforge.common.ForgeMod; import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionInteractionPacket extends SimplePacketBase { 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.client.Minecraft;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ContraptionSeatMappingPacket extends SimplePacketBase { public class ContraptionSeatMappingPacket extends SimplePacketBase {

View file

@ -10,7 +10,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class LimbSwingUpdatePacket extends SimplePacketBase { 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.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.vehicle.AbstractMinecart; 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 { 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.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.util.INBTSerializable; 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 * 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.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class MinecartControllerUpdatePacket extends SimplePacketBase { public class MinecartControllerUpdatePacket extends SimplePacketBase {

View file

@ -154,8 +154,7 @@ public class OpenEndedPipe extends FlowSource {
if (waterlog) { if (waterlog) {
world.setBlock(outputPos, state.setValue(WATERLOGGED, false), 3); world.setBlock(outputPos, state.setValue(WATERLOGGED, false), 3);
world.getLiquidTicks() world.scheduleTick(outputPos, Fluids.WATER, 1);
.scheduleTick(outputPos, Fluids.WATER, 1);
return stack; return stack;
} }
world.setBlock(outputPos, fluidState.createLegacyBlock() world.setBlock(outputPos, fluidState.createLegacyBlock()
@ -212,8 +211,7 @@ public class OpenEndedPipe extends FlowSource {
if (waterlog) { if (waterlog) {
world.setBlock(outputPos, state.setValue(WATERLOGGED, true), 3); world.setBlock(outputPos, state.setValue(WATERLOGGED, true), 3);
world.getLiquidTicks() world.scheduleTick(outputPos, Fluids.WATER, 1);
.scheduleTick(outputPos, Fluids.WATER, 1);
return true; 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.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; 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.Block;
import net.minecraft.world.level.block.SimpleWaterloggedBlock; import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.entity.BlockEntity; 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.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterloggedBlock, ICogWheel, ITE<PumpTileEntity> { public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterloggedBlock, ICogWheel, ITE<PumpTileEntity> {
@ -71,8 +71,7 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
return; return;
if (!isOpenAt(state, d)) if (!isOpenAt(state, d))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override
@ -90,10 +89,8 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
@Override @Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world, public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) { BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) { if (state.getValue(BlockStateProperties.WATERLOGGED))
world.getLiquidTicks() world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
return state; return state;
} }
@ -115,8 +112,7 @@ public class PumpBlock extends DirectionalKineticBlock implements SimpleWaterlog
if (world.isClientSide) if (world.isClientSide)
return; return;
if (state != oldState) if (state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
if (isPump(state) && isPump(oldState) && state.getValue(FACING) == oldState.getValue(FACING) if (isPump(state) && isPump(oldState) && state.getValue(FACING) == oldState.getValue(FACING)
.getOpposite()) { .getOpposite()) {

View file

@ -23,9 +23,6 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags; import net.minecraft.tags.FluidTags;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; 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.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.DoorBlock; 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.Fluids;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.ticks.LevelTickAccess;
import net.minecraft.world.ticks.LevelTicks;
public class FluidFillingBehaviour extends FluidManipulationBehaviour { public class FluidFillingBehaviour extends FluidManipulationBehaviour {
@ -191,20 +190,10 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour {
.createLegacyBlock(), 2 | 16); .createLegacyBlock(), 2 | 16);
} }
TickList<Fluid> pendingFluidTicks = world.getLiquidTicks(); LevelTickAccess<Fluid> pendingFluidTicks = world.getFluidTicks();
if (pendingFluidTicks instanceof ServerTickList) { if (pendingFluidTicks instanceof LevelTicks) {
ServerTickList<Fluid> serverTickList = (ServerTickList<Fluid>) pendingFluidTicks; LevelTicks<Fluid> serverTickList = (LevelTicks<Fluid>) pendingFluidTicks;
TickNextTickData<Fluid> removedEntry = null; serverTickList.clearArea(new BoundingBox(currentPos));
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);
}
} }
affectedArea.encapsulate(BoundingBox.fromCorners(currentPos, currentPos)); affectedArea.encapsulate(BoundingBox.fromCorners(currentPos, currentPos));

View file

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

View file

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

View file

@ -1,7 +1,5 @@
package com.simibubi.create.content.contraptions.fluids.particle; package com.simibubi.create.content.contraptions.fluids.particle;
import java.util.Optional;
import com.mojang.brigadier.StringReader; import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
@ -10,10 +8,8 @@ import com.simibubi.create.AllParticleTypes;
import com.simibubi.create.content.contraptions.particle.ICustomParticleData; import com.simibubi.create.content.contraptions.particle.ICustomParticleData;
import net.minecraft.client.particle.ParticleProvider; import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.ParticleType;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@ -57,29 +53,18 @@ public class FluidParticleData implements ParticleOptions, ICustomParticleData<F
.getRegistryName(); .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 public static final Codec<FluidParticleData> CODEC = RecordCodecBuilder.create(i -> i
.group(FLUID_CODEC.fieldOf("fluid") .group(FluidStack.CODEC.fieldOf("fluid")
.forGetter(p -> p.fluid)) .forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.FLUID_PARTICLE.get(), fs))); .apply(i, fs -> new FluidParticleData(AllParticleTypes.FLUID_PARTICLE.get(), fs)));
public static final Codec<FluidParticleData> BASIN_CODEC = RecordCodecBuilder.create(i -> i 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)) .forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.BASIN_FLUID.get(), fs))); .apply(i, fs -> new FluidParticleData(AllParticleTypes.BASIN_FLUID.get(), fs)));
public static final Codec<FluidParticleData> DRIP_CODEC = RecordCodecBuilder.create(i -> i 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)) .forGetter(p -> p.fluid))
.apply(i, fs -> new FluidParticleData(AllParticleTypes.FLUID_DRIP.get(), fs))); .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.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; 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.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.RotatedPillarBlock; 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.HitResult;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWithBracket, IAxisPipe { public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWithBracket, IAxisPipe {
@ -77,12 +77,11 @@ public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWith
if (world.isClientSide) if (world.isClientSide)
return; return;
if (state != oldState) if (state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @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) { Player player) {
return AllBlocks.FLUID_PIPE.asStack(); return AllBlocks.FLUID_PIPE.asStack();
} }
@ -96,8 +95,7 @@ public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchableWith
return; return;
if (!isOpenAt(state, d)) if (!isOpenAt(state, d))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
public static boolean isOpenAt(BlockState state, Direction d) { 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.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; 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.Block;
import net.minecraft.world.level.block.PipeBlock; import net.minecraft.world.level.block.PipeBlock;
import net.minecraft.world.level.block.entity.BlockEntity; 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.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.HitResult;
import net.minecraft.world.ticks.TickPriority;
public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBlockItemRequirement, ITE<FluidPipeTileEntity> { public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBlockItemRequirement, ITE<FluidPipeTileEntity> {
@ -72,12 +72,11 @@ public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBloc
@Override @Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean isMoving) { public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean isMoving) {
if (!world.isClientSide && state != oldState) if (!world.isClientSide && state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @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(); return AllBlocks.FLUID_PIPE.asStack();
} }
@ -90,8 +89,7 @@ public class EncasedPipeBlock extends Block implements IWrenchable, ISpecialBloc
return; return;
if (!state.getValue(FACING_TO_PROPERTY_MAP.get(d))) if (!state.getValue(FACING_TO_PROPERTY_MAP.get(d)))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override

View file

@ -33,7 +33,6 @@ import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; 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.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.PipeBlock; 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.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.ticks.TickPriority;
public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock, IWrenchableWithBracket, ITE<FluidPipeTileEntity> { public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock, IWrenchableWithBracket, ITE<FluidPipeTileEntity> {
@ -138,8 +138,7 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
if (world.isClientSide) if (world.isClientSide)
return; return;
if (state != oldState) if (state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override
@ -151,8 +150,7 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
return; return;
if (!isOpenAt(state, d)) if (!isOpenAt(state, d))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override
@ -242,11 +240,9 @@ public class FluidPipeBlock extends PipeBlock implements SimpleWaterloggedBlock,
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world, public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) { BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(BlockStateProperties.WATERLOGGED)) if (state.getValue(BlockStateProperties.WATERLOGGED))
world.getLiquidTicks() world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
if (isOpenAt(state, direction) && neighbourState.hasProperty(BlockStateProperties.WATERLOGGED)) if (isOpenAt(state, direction) && neighbourState.hasProperty(BlockStateProperties.WATERLOGGED))
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
return updateBlockState(state, direction, direction.getOpposite(), world, pos); 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.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -28,6 +27,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxisPipe, ITE<FluidValveTileEntity> { public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxisPipe, ITE<FluidValveTileEntity> {
@ -102,8 +102,7 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxi
if (world.isClientSide) if (world.isClientSide)
return; return;
if (state != oldState) if (state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override
@ -115,8 +114,7 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxi
return; return;
if (!isOpenAt(state, d)) if (!isOpenAt(state, d))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
public static boolean isOpenAt(BlockState state, Direction d) { 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.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock; import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock;
import net.minecraft.world.level.block.entity.BlockEntityType; 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.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
implements ITE<SmartFluidPipeTileEntity>, IAxisPipe, IWrenchable { implements ITE<SmartFluidPipeTileEntity>, IAxisPipe, IWrenchable {
@ -101,8 +101,7 @@ public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
if (world.isClientSide) if (world.isClientSide)
return; return;
if (state != oldState) if (state != oldState)
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
@Override @Override
@ -114,8 +113,7 @@ public class SmartFluidPipeBlock extends FaceAttachedHorizontalDirectionalBlock
return; return;
if (!isOpenAt(state, d)) if (!isOpenAt(state, d))
return; return;
world.getBlockTicks() world.scheduleTick(pos, this, 1, TickPriority.HIGH);
.scheduleTick(pos, this, 1, TickPriority.HIGH);
} }
public static boolean isOpenAt(BlockState state, Direction d) { 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.content.contraptions.components.structureMovement.piston.PistonExtensionPoleBlock;
import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.config.CClient; 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.Theme;
import com.simibubi.create.foundation.gui.element.GuiGameElement; import com.simibubi.create.foundation.gui.element.GuiGameElement;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBox; 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.minecraft.world.phys.HitResult;
import net.minecraftforge.client.gui.ForgeIngameGui; import net.minecraftforge.client.gui.ForgeIngameGui;
import net.minecraftforge.client.gui.IIngameOverlay; import net.minecraftforge.client.gui.IIngameOverlay;
import net.minecraftforge.fmlclient.gui.GuiUtils;
public class GoggleOverlayRenderer { public class GoggleOverlayRenderer {
@ -195,7 +195,7 @@ public class GoggleOverlayRenderer {
colorBorderBot.scaleAlpha(fade); 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); colorBackground.getRGB(), colorBorderTop.getRGB(), colorBorderBot.getRGB(), mc.font);
ItemStack item = AllItems.GOGGLES.asStack(); ItemStack item = AllItems.GOGGLES.asStack();

View file

@ -167,8 +167,7 @@ public class BasinBlock extends Block implements ITE<BasinTileEntity>, IWrenchab
@Override @Override
public VoxelShape getCollisionShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext ctx) { public VoxelShape getCollisionShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext ctx) {
if (ctx instanceof EntityCollisionContext && ((EntityCollisionContext) ctx).getEntity() if (ctx instanceof EntityCollisionContext && ((EntityCollisionContext) ctx).getEntity() instanceof ItemEntity)
.orElse(null) instanceof ItemEntity)
return AllShapes.BASIN_COLLISION_SHAPE; return AllShapes.BASIN_COLLISION_SHAPE;
return getShape(state, reader, pos, ctx); 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.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource; 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.InteractionHand;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
@ -89,18 +90,22 @@ public class BlazeBurnerBlockItem extends BlockItem {
return super.useOn(context); return super.useOn(context);
BaseSpawner spawner = ((SpawnerBlockEntity) te).getSpawner(); BaseSpawner spawner = ((SpawnerBlockEntity) te).getSpawner();
WeightedRandomList<SpawnData> spawnPotentials = SimpleWeightedRandomList<SpawnData> spawnPotentials =
ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45443_"); // 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 = new ArrayList<>();
possibleSpawns possibleSpawns.add(ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45444_")); // nextSpawnData
.add(ObfuscationReflectionHelper.getPrivateValue(BaseSpawner.class, spawner, "f_45444_")); // nextSpawnData
} }
ResourceLocation blazeId = EntityType.BLAZE.getRegistryName(); ResourceLocation blazeId = EntityType.BLAZE.getRegistryName();
for (SpawnData e : possibleSpawns) { for (SpawnData e : possibleSpawns) {
ResourceLocation spawnerEntityId = new ResourceLocation(e.getTag() ResourceLocation spawnerEntityId = new ResourceLocation(e.entityToSpawn()
.getString("id")); .getString("id"));
if (!spawnerEntityId.equals(blazeId)) if (!spawnerEntityId.equals(blazeId))
continue; continue;
@ -117,7 +122,8 @@ public class BlazeBurnerBlockItem extends BlockItem {
} }
@Override @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()) if (hasCapturedBlaze())
return InteractionResult.PASS; return InteractionResult.PASS;
if (!(entity instanceof Blaze)) if (!(entity instanceof Blaze))
@ -141,7 +147,8 @@ public class BlazeBurnerBlockItem extends BlockItem {
player.setItemInHand(hand, filled); player.setItemInHand(hand, filled);
return; return;
} }
player.getInventory().placeItemBackInInventory(filled); player.getInventory()
.placeItemBackInInventory(filled);
} }
private void spawnCaptureEffects(Level world, Vec3 vec) { private void spawnCaptureEffects(Level world, Vec3 vec) {

View file

@ -71,7 +71,7 @@ public class LitBlazeBurnerBlock extends Block implements IWrenchable {
} }
@Override @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) { Player player) {
return AllItems.EMPTY_BLAZE_BURNER.asStack(); return AllItems.EMPTY_BLAZE_BURNER.asStack();
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -62,11 +62,11 @@ public class EncasedShaftBlock extends AbstractEncasedShaftBlock
} }
@Override @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) if (target instanceof BlockHitResult)
return ((BlockHitResult) target).getDirection() return ((BlockHitResult) target).getDirection()
.getAxis() == getRotationAxis(state) ? AllBlocks.SHAFT.asStack() : getCasing().asStack(); .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 @Override

View file

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

View file

@ -50,10 +50,10 @@ public class GearboxBlock extends RotatedPillarKineticBlock implements ITE<Gearb
} }
@Override @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) { Player player) {
if (state.getValue(AXIS).isVertical()) 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()); return new ItemStack(AllItems.VERTICAL_GEARBOX.get());
} }

View file

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

View file

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

View file

@ -5,6 +5,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import com.google.common.collect.Streams;
import com.simibubi.create.content.curiosities.bell.SoulParticle.ExpandingPerimeterData; import com.simibubi.create.content.curiosities.bell.SoulParticle.ExpandingPerimeterData;
import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.foundation.utility.VecHelper;
@ -75,7 +76,7 @@ public class SoulPulseEffect {
} }
public static boolean isDark(Level world, BlockPos at) { 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) { 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 dummyWidth = 0.2, dummyHeight = 0.75;
double w2 = dummyWidth / 2; double w2 = dummyWidth / 2;
return world != null return world != null && NaturalSpawner.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, at, dummy)
&& NaturalSpawner
.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, at, dummy)
&& (ignoreLight || isDark(world, at)) && (ignoreLight || isDark(world, at))
&& world && Streams
.getBlockCollisions(null, .stream(world.getBlockCollisions(null,
new AABB(at.getX() + 0.5 - w2, at.getY(), at.getZ() + 0.5 - w2, at.getX() + 0.5 + w2, 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), at.getY() + dummyHeight, at.getZ() + 0.5 + w2)))
(a, b) -> true)
.allMatch(VoxelShape::isEmpty); .allMatch(VoxelShape::isEmpty);
} }
@ -105,7 +103,7 @@ public class SoulPulseEffect {
.distanceTo(VecHelper.getCenterOf(at)))) >= distance ? new SoulParticle.PerimeterData() .distanceTo(VecHelper.getCenterOf(at)))) >= distance ? new SoulParticle.PerimeterData()
: new ExpandingPerimeterData(), : new ExpandingPerimeterData(),
p.x + 0.5, p.y + 0.5, p.z + 0.5, 0, 0, 0); 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.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); 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.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.fmllegacy.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
public class SoulPulseEffectPacket extends SimplePacketBase { 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.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class ConfigureSymmetryWandPacket extends SimplePacketBase { public class ConfigureSymmetryWandPacket extends SimplePacketBase {

View file

@ -12,7 +12,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class SymmetryEffectPacket extends SimplePacketBase { 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.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; 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.client.model.data.EmptyModelData;
import net.minecraftforge.event.TickEvent.ClientTickEvent; import net.minecraftforge.event.TickEvent.ClientTickEvent;
import net.minecraftforge.event.TickEvent.Phase; import net.minecraftforge.event.TickEvent.Phase;
@ -82,7 +82,7 @@ public class SymmetryHandler {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@SubscribeEvent @SubscribeEvent
public static void render(RenderWorldLastEvent event) { public static void render(RenderLevelLastEvent event) {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getInstance();
LocalPlayer player = mc.player; LocalPlayer player = mc.player;
@ -109,7 +109,7 @@ public class SymmetryHandler {
Camera info = mc.gameRenderer.getMainCamera(); Camera info = mc.gameRenderer.getMainCamera();
Vec3 view = info.getPosition(); Vec3 view = info.getPosition();
PoseStack ms = event.getMatrixStack(); PoseStack ms = event.getPoseStack();
ms.pushPose(); ms.pushPose();
ms.translate(-view.x(), -view.y(), -view.z()); ms.translate(-view.x(), -view.y(), -view.z());
ms.translate(pos.getX(), pos.getY(), pos.getZ()); 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.common.util.BlockSnapshot;
import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class SymmetryWandItem extends Item { 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.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.util.FakePlayer; 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> { 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, public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) { BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(WATERLOGGED)) if (state.getValue(WATERLOGGED))
world.getLiquidTicks() world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
return state; return state;
} }

View file

@ -14,7 +14,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity; 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; import net.minecraftforge.items.ItemHandlerHelper;
public class ToolboxDisposeAllPacket extends SimplePacketBase { 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.item.ItemStack;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity; 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; import net.minecraftforge.items.ItemHandlerHelper;
public class ToolboxEquipPacket extends SimplePacketBase { 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.LevelAccessor;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class ToolboxHandler { public class ToolboxHandler {

View file

@ -69,7 +69,7 @@ public class ToolboxHandlerClient {
BlockState state = level.getBlockState(pos); BlockState state = level.getBlockState(pos);
if (state.getMaterial() == Material.AIR) if (state.getMaterial() == Material.AIR)
return false; return false;
result = state.getPickBlock(hitResult, level, pos, player); result = state.getCloneItemStack(hitResult, level, pos, player);
} else if (hitResult.getType() == HitResult.Type.ENTITY) { } else if (hitResult.getType() == HitResult.Type.ENTITY) {
Entity entity = ((EntityHitResult) hitResult).getEntity(); 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.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class BlueprintAssignCompleteRecipePacket extends SimplePacketBase { 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.ForgeHooks;
import net.minecraftforge.common.ForgeMod; import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.hooks.BasicEventHooks; import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.InvWrapper; import net.minecraftforge.items.wrapper.InvWrapper;
import net.minecraftforge.network.NetworkHooks;
public class BlueprintEntity extends HangingEntity public class BlueprintEntity extends HangingEntity
implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, ISyncPersistentData, IInteractionChecker { implements IEntityAdditionalSpawnData, ISpecialEntityItemRequirement, ISyncPersistentData, IInteractionChecker {
@ -399,7 +399,7 @@ public class BlueprintEntity extends HangingEntity
} else { } else {
amountCrafted += result.getCount(); amountCrafted += result.getCount();
result.onCraftedBy(player.level, player, 1); result.onCraftedBy(player.level, player, 1);
BasicEventHooks.firePlayerCraftingEvent(player, result, craftingInventory); ForgeEventFactory.firePlayerCraftingEvent(player, result, craftingInventory);
NonNullList<ItemStack> nonnulllist = level.getRecipeManager() NonNullList<ItemStack> nonnulllist = level.getRecipeManager()
.getRemainingItemsFor(RecipeType.CRAFTING, craftingInventory, level); .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.Recipe;
import net.minecraft.world.item.crafting.ShapedRecipe; import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraft.world.level.Level; 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.fml.util.ObfuscationReflectionHelper;
import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.ItemStackHandler;
@ -133,7 +133,7 @@ public class BlueprintItem extends Item {
return filterItem; return filterItem;
} }
if (itemList instanceof StackList) { if (itemList instanceof MultiItemValue) {
ItemStack result = AllItems.FILTER.asStack(); ItemStack result = AllItems.FILTER.asStack();
ItemStackHandler filterItems = FilterItem.getFilterItems(result); ItemStackHandler filterItems = FilterItem.getFilterItems(result);
int i = 0; int i = 0;

View file

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

View file

@ -64,7 +64,7 @@ public class ExtendoGripRenderHandler {
if (notInOffhand && !AllItems.EXTENDO_GRIP.isIn(heldItem)) if (notInOffhand && !AllItems.EXTENDO_GRIP.isIn(heldItem))
return; return;
PoseStack ms = event.getMatrixStack(); PoseStack ms = event.getPoseStack();
TransformStack msr = TransformStack.cast(ms); TransformStack msr = TransformStack.cast(ms);
AbstractClientPlayer abstractclientplayerentity = mc.player; AbstractClientPlayer abstractclientplayerentity = mc.player;
RenderSystem.setShaderTexture(0, abstractclientplayerentity.getSkinTextureLocation()); RenderSystem.setShaderTexture(0, abstractclientplayerentity.getSkinTextureLocation());
@ -99,9 +99,11 @@ public class ExtendoGripRenderHandler {
PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher() PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher()
.getRenderer(player); .getRenderer(player);
if (rightHand) if (rightHand)
playerrenderer.renderRightHand(event.getMatrixStack(), event.getBuffers(), event.getLight(), player); playerrenderer.renderRightHand(event.getPoseStack(), event.getMultiBufferSource(),
event.getPackedLight(), player);
else else
playerrenderer.renderLeftHand(event.getMatrixStack(), event.getBuffers(), event.getLight(), player); playerrenderer.renderLeftHand(event.getPoseStack(), event.getMultiBufferSource(),
event.getPackedLight(), player);
ms.popPose(); ms.popPose();
// Render gun // Render gun
@ -111,7 +113,7 @@ public class ExtendoGripRenderHandler {
TransformType transform = TransformType transform =
rightHand ? TransformType.FIRST_PERSON_RIGHT_HAND : TransformType.FIRST_PERSON_LEFT_HAND; rightHand ? TransformType.FIRST_PERSON_RIGHT_HAND : TransformType.FIRST_PERSON_LEFT_HAND;
firstPersonRenderer.renderItem(mc.player, notInOffhand ? heldItem : offhandItem, transform, !rightHand, firstPersonRenderer.renderItem(mc.player, notInOffhand ? heldItem : offhandItem, transform, !rightHand,
event.getMatrixStack(), event.getBuffers(), event.getLight()); event.getPoseStack(), event.getMultiBufferSource(), event.getPackedLight());
if (!notInOffhand) { if (!notInOffhand) {
ForgeHooksClient.handleCameraTransforms(ms, mc.getItemRenderer() ForgeHooksClient.handleCameraTransforms(ms, mc.getItemRenderer()
@ -126,8 +128,8 @@ public class ExtendoGripRenderHandler {
ms.scale(1.25f, 1.25f, 1.25f); ms.scale(1.25f, 1.25f, 1.25f);
} }
firstPersonRenderer.renderItem(mc.player, heldItem, transform, !rightHand, event.getMatrixStack(), firstPersonRenderer.renderItem(mc.player, heldItem, transform, !rightHand, event.getPoseStack(),
event.getBuffers(), event.getLight()); event.getMultiBufferSource(), event.getPackedLight());
} }
ms.popPose(); 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.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.entity.IEntityAdditionalSpawnData;
import net.minecraftforge.fmllegacy.network.NetworkHooks;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.network.NetworkHooks;
public class PotatoProjectileEntity extends AbstractHurtingProjectile implements IEntityAdditionalSpawnData { 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.util.profiling.ProfilerFiller;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.registries.IRegistryDelegate; import net.minecraftforge.registries.IRegistryDelegate;
public class PotatoProjectileTypeManager { public class PotatoProjectileTypeManager {

View file

@ -8,7 +8,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.ItemStack; 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 { 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.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; 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 { 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.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fmllegacy.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
public class ShootableGadgetItemMethods { 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.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.entity.player.PlayerRenderer; import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.HumanoidArm; import net.minecraft.world.entity.HumanoidArm;
@ -77,14 +76,13 @@ public abstract class ShootableGadgetRenderHandler {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getInstance();
AbstractClientPlayer player = mc.player; AbstractClientPlayer player = mc.player;
TextureManager textureManager = mc.getTextureManager();
PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher() PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher()
.getRenderer(player); .getRenderer(player);
ItemInHandRenderer firstPersonRenderer = mc.getItemInHandRenderer(); ItemInHandRenderer firstPersonRenderer = mc.getItemInHandRenderer();
PoseStack ms = event.getMatrixStack(); PoseStack ms = event.getPoseStack();
MultiBufferSource buffer = event.getBuffers(); MultiBufferSource buffer = event.getMultiBufferSource();
int light = event.getLight(); int light = event.getPackedLight();
float pt = event.getPartialTicks(); float pt = event.getPartialTicks();
boolean rightHand = event.getHand() == InteractionHand.MAIN_HAND ^ mc.player.getMainArm() == HumanoidArm.LEFT; boolean rightHand = event.getHand() == InteractionHand.MAIN_HAND ^ mc.player.getMainArm() == HumanoidArm.LEFT;

View file

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

View file

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

View file

@ -9,7 +9,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity; 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 { 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.Level;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.fmllegacy.network.NetworkEvent.Context; import net.minecraftforge.network.NetworkEvent.Context;
public class EjectorPlacementPacket extends SimplePacketBase { 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.InteractionResult;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; 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.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.RedStoneWireBlock; import net.minecraft.world.level.block.RedStoneWireBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder; import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.ticks.TickPriority;
public class PoweredLatchBlock extends ToggleLatchBlock { public class PoweredLatchBlock extends ToggleLatchBlock {
@ -49,8 +49,7 @@ public class PoweredLatchBlock extends ToggleLatchBlock {
.willTickThisTick(pos, this)) .willTickThisTick(pos, this))
return; return;
if (back != shouldBack || side != shouldSide) if (back != shouldBack || side != shouldSide)
worldIn.getBlockTicks() worldIn.scheduleTick(pos, this, this.getDelay(state), tickpriority);
.scheduleTick(pos, this, this.getDelay(state), tickpriority);
} }
protected boolean isPoweredOnSides(Level worldIn, BlockPos pos, BlockState state) { 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); behaviour.onNeighborChanged(fromPos);
if (!worldIn.getBlockTicks() if (!worldIn.getBlockTicks()
.willTickThisTick(pos, this)) .willTickThisTick(pos, this))
worldIn.getBlockTicks() worldIn.scheduleTick(pos, this, 0);
.scheduleTick(pos, this, 0);
} }
@Override @Override

View file

@ -80,8 +80,8 @@ public class BeltFunnelBlock extends AbstractHorizontalFunnelBlock implements IS
@Override @Override
public VoxelShape getCollisionShape(BlockState p_220071_1_, BlockGetter p_220071_2_, BlockPos p_220071_3_, public VoxelShape getCollisionShape(BlockState p_220071_1_, BlockGetter p_220071_2_, BlockPos p_220071_3_,
CollisionContext p_220071_4_) { CollisionContext p_220071_4_) {
if (p_220071_4_ instanceof EntityCollisionContext && ((EntityCollisionContext) p_220071_4_).getEntity() if (p_220071_4_ instanceof EntityCollisionContext
.orElse(null) instanceof ItemEntity && ((EntityCollisionContext) p_220071_4_).getEntity() instanceof ItemEntity
&& (p_220071_1_.getValue(SHAPE) == Shape.PULLING || p_220071_1_.getValue(SHAPE) == Shape.PUSHING)) && (p_220071_1_.getValue(SHAPE) == Shape.PULLING || p_220071_1_.getValue(SHAPE) == Shape.PUSHING))
return AllShapes.FUNNEL_COLLISION.get(getFacing(p_220071_1_)); return AllShapes.FUNNEL_COLLISION.get(getFacing(p_220071_1_));
return getShape(p_220071_1_, p_220071_2_, p_220071_3_, p_220071_4_); 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 @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(); return parent.asStack();
} }

View file

@ -138,8 +138,8 @@ public abstract class FunnelBlock extends AbstractDirectionalFunnelBlock {
@Override @Override
public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
if (context instanceof EntityCollisionContext && ((EntityCollisionContext) context).getEntity() if (context instanceof EntityCollisionContext
.orElse(null) instanceof ItemEntity && getFacing(state).getAxis() && ((EntityCollisionContext) context).getEntity() instanceof ItemEntity && getFacing(state).getAxis()
.isHorizontal()) .isHorizontal())
return AllShapes.FUNNEL_COLLISION.get(getFacing(state)); return AllShapes.FUNNEL_COLLISION.get(getFacing(state));
return getShape(state, world, pos, context); 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.server.level.ServerPlayer;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity; 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 { public class ArmPlacementPacket extends SimplePacketBase {

View file

@ -8,9 +8,9 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.nbt.NbtUtils; import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.TickPriority;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.ticks.TickPriority;
public class ContactMovementBehaviour extends MovementBehaviour { public class ContactMovementBehaviour extends MovementBehaviour {
@ -53,7 +53,7 @@ public class ContactMovementBehaviour extends MovementBehaviour {
public void deactivateLastVisitedContact(MovementContext context) { public void deactivateLastVisitedContact(MovementContext context) {
if (context.data.contains("lastContact")) { if (context.data.contains("lastContact")) {
BlockPos last = NbtUtils.readBlockPos(context.data.getCompound("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"); context.data.remove("lastContact");
} }
} }

View file

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

View file

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

View file

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

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