Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more porting #469

Merged
merged 6 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/com/aetherteam/aetherii/block/AetherIIBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,17 @@ public class AetherIIBlocks extends AetherIIBlockBuilders {
public static final DeferredBlock<BedBlock> SKYROOT_BED = register("skyroot_bed", () -> new SkyrootBedBlock(DyeColor.WHITE, Block.Properties.ofFullCopy(Blocks.WHITE_BED)));

public static final DeferredBlock<StandingSignBlock> SKYROOT_SIGN = register("skyroot_sign", () -> new StandingSignBlock(AetherIIWoodTypes.SKYROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<WallSignBlock> SKYROOT_WALL_SIGN = BLOCKS.register("skyroot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.SKYROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD).lootFrom(SKYROOT_SIGN)));
public static final DeferredBlock<WallSignBlock> SKYROOT_WALL_SIGN = BLOCKS.register("skyroot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.SKYROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<CeilingHangingSignBlock> SKYROOT_HANGING_SIGN = register("skyroot_hanging_sign", () -> new CeilingHangingSignBlock(AetherIIWoodTypes.SKYROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));
public static final DeferredBlock<WallHangingSignBlock> SKYROOT_WALL_HANGING_SIGN = BLOCKS.register("skyroot_wall_hanging_sign", () -> new WallHangingSignBlock(AetherIIWoodTypes.SKYROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));

public static final DeferredBlock<StandingSignBlock> GREATROOT_SIGN = register("greatroot_sign", () -> new StandingSignBlock(AetherIIWoodTypes.GREATROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<WallSignBlock> GREATROOT_WALL_SIGN = BLOCKS.register("greatroot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.GREATROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD).lootFrom(GREATROOT_SIGN)));
public static final DeferredBlock<WallSignBlock> GREATROOT_WALL_SIGN = BLOCKS.register("greatroot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.GREATROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<CeilingHangingSignBlock> GREATROOT_HANGING_SIGN = register("greatroot_hanging_sign", () -> new CeilingHangingSignBlock(AetherIIWoodTypes.GREATROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));
public static final DeferredBlock<WallHangingSignBlock> GREATROOT_WALL_HANGING_SIGN = BLOCKS.register("greatroot_wall_hanging_sign", () -> new WallHangingSignBlock(AetherIIWoodTypes.GREATROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));

public static final DeferredBlock<StandingSignBlock> WISPROOT_SIGN = register("wisproot_sign", () -> new StandingSignBlock(AetherIIWoodTypes.WISPROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<WallSignBlock> WISPROOT_WALL_SIGN = BLOCKS.register("wisproot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.WISPROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD).lootFrom(GREATROOT_SIGN)));
public static final DeferredBlock<WallSignBlock> WISPROOT_WALL_SIGN = BLOCKS.register("wisproot_wall_sign", () -> new WallSignBlock(AetherIIWoodTypes.WISPROOT, Block.Properties.of().mapColor(MapColor.SAND).forceSolidOn().ignitedByLava().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).sound(SoundType.WOOD)));
public static final DeferredBlock<CeilingHangingSignBlock> WISPROOT_HANGING_SIGN = register("wisproot_hanging_sign", () -> new CeilingHangingSignBlock(AetherIIWoodTypes.WISPROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));
public static final DeferredBlock<WallHangingSignBlock> WISPROOT_WALL_HANGING_SIGN = BLOCKS.register("wisproot_wall_hanging_sign", () -> new WallHangingSignBlock(AetherIIWoodTypes.WISPROOT, BlockBehaviour.Properties.of().mapColor(Blocks.OAK_LOG.defaultMapColor()).forceSolidOn().instrument(NoteBlockInstrument.BASS).noCollission().strength(1.0F).ignitedByLava()));

Expand Down Expand Up @@ -626,21 +626,21 @@ private static <T extends Block> Supplier<BlockItem> registerBlockItem(final Def
if (block == HOLYSTONE_ROCK) {
return new RockItem(HOLYSTONE_ROCK.get(), new Item.Properties());
} else if (block == AMBROSIUM_TORCH) {
return new StandingAndWallBlockItem(AMBROSIUM_TORCH.get(), AMBROSIUM_WALL_TORCH.get(), new Item.Properties(), Direction.DOWN);
return new StandingAndWallBlockItem(AMBROSIUM_TORCH.get(), AMBROSIUM_WALL_TORCH.get(), Direction.DOWN, new Item.Properties());
} else if (block == SKYROOT_CHEST) {
return new EntityBlockItem(block.get(), SkyrootChestBlockEntity::new, new Item.Properties());
} else if (block == SKYROOT_BED) {
return new EntityBlockItem(block.get(), SkyrootBedBlockEntity::new, new Item.Properties().stacksTo(1));
} else if (block == SKYROOT_SIGN) {
return new SignItem(new Item.Properties().stacksTo(16), SKYROOT_SIGN.get(), SKYROOT_WALL_SIGN.get());
return new SignItem(SKYROOT_SIGN.get(), SKYROOT_WALL_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == SKYROOT_HANGING_SIGN) {
return new HangingSignItem(SKYROOT_HANGING_SIGN.get(), SKYROOT_WALL_HANGING_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == GREATROOT_SIGN) {
return new SignItem(new Item.Properties().stacksTo(16), GREATROOT_SIGN.get(), GREATROOT_WALL_SIGN.get());
return new SignItem(GREATROOT_SIGN.get(), GREATROOT_WALL_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == GREATROOT_HANGING_SIGN) {
return new HangingSignItem(GREATROOT_HANGING_SIGN.get(), GREATROOT_WALL_HANGING_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == WISPROOT_SIGN) {
return new SignItem(new Item.Properties().stacksTo(16), WISPROOT_SIGN.get(), WISPROOT_WALL_SIGN.get());
return new SignItem(WISPROOT_SIGN.get(), WISPROOT_WALL_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == WISPROOT_HANGING_SIGN) {
return new HangingSignItem(WISPROOT_HANGING_SIGN.get(), WISPROOT_WALL_HANGING_SIGN.get(), new Item.Properties().stacksTo(16));
} else if (block == OUTPOST_CAMPFIRE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public ItemStack execute(BlockSource source, ItemStack stack) {
};

public static final DispenseItemBehavior SKYROOT_BUCKET_PICKUP_BEHAVIOR = new DefaultDispenseItemBehavior() {
private final DefaultDispenseItemBehavior defaultDispenseItemBehavior = new DefaultDispenseItemBehavior();

@Override
public ItemStack execute(BlockSource source, ItemStack stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import com.aetherteam.aetherii.AetherII;
import com.aetherteam.aetherii.client.particle.AetherIIParticleTypes;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.PointedDripstoneBlock;
import net.minecraft.world.level.pathfinder.PathType;
import net.neoforged.neoforge.common.SoundActions;
import net.neoforged.neoforge.fluids.FluidType;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSourc
level.addParticle(AetherIIParticleTypes.AMBROSIUM.get(), d0 + 0.27 * (double) opposite.getStepX(), d1 + 0.2, d2 + 0.27 * (double) opposite.getStepZ(), 0.0, 0.0, 0.0);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, Block
* [CODE COPY] - {@link net.minecraft.world.level.block.BaseEntityBlock#triggerEvent(BlockState, Level, BlockPos, int, int)}.<br><br>
* Warning for "deprecation" is suppressed because the method is fine to override.
*/
@SuppressWarnings("deprecation")
@Override
public boolean triggerEvent(BlockState state, Level level, BlockPos pos, int id, int param) {
super.triggerEvent(state, level, pos, id, param);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public SecretDoorBlock(BlockSetType blockSetType, Properties properties) {
}

@Override
public boolean useShapeForLightOcclusion(BlockState pState) {
public boolean useShapeForLightOcclusion(BlockState state) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public SecretTrapDoorBlock(BlockSetType blockSetType, Properties properties) {
}

@Override
public boolean useShapeForLightOcclusion(BlockState pState) {
public boolean useShapeForLightOcclusion(BlockState state) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new HolystoneFurnaceBlockEntity(pos, state);
}

@Override
@Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
return level.isClientSide() ? null : createTickerHelper(blockEntityType, AetherIIBlockEntityTypes.HOLYSTONE_FURNACE.get(), AbstractFurnaceBlockEntity::serverTick);
return createFurnaceTicker(level, blockEntityType, AetherIIBlockEntityTypes.HOLYSTONE_FURNACE.get());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public boolean isOrigin() {
public ClientboundBlockEntityDataPacket getUpdatePacket() {
return ClientboundBlockEntityDataPacket.create(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.TriState;
import net.neoforged.neoforge.client.event.RegisterRenderBuffersEvent;

public class AetherIIRenderTypes {
Expand All @@ -18,7 +19,7 @@ public class AetherIIRenderTypes {
1536,
RenderType.CompositeState.builder()
.setShaderState(RenderType.RENDERTYPE_GLINT_SHADER)
.setTextureState(new RenderStateShard.TextureStateShard(IRRADIATED_GLINT_ITEM, true, false))
.setTextureState(new RenderStateShard.TextureStateShard(IRRADIATED_GLINT_ITEM, TriState.TRUE, false))
.setWriteMaskState(RenderType.COLOR_WRITE)
.setCullState(RenderType.NO_CULL)
.setDepthTestState(RenderType.EQUAL_DEPTH_TEST)
Expand All @@ -34,4 +35,4 @@ public static RenderType irradiatedGlint() {
public static void registerRenderBuffers(RegisterRenderBuffersEvent event) {
event.registerRenderBuffer(irradiatedGlint());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,18 @@
import com.aetherteam.aetherii.client.renderer.entity.model.taegore.TaegoreModel;
import com.aetherteam.aetherii.entity.AetherIIEntityTypes;
import com.aetherteam.aetherii.item.AetherIIItems;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import io.wispforest.accessories.api.client.AccessoriesRendererRegistry;
import net.minecraft.client.model.geom.builders.CubeDeformation;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BedRenderer;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.NoopRenderer;
import net.minecraft.client.renderer.entity.ThrownItemRenderer;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.event.ModelEvent;
import net.neoforged.neoforge.registries.DeferredBlock;
import org.spongepowered.asm.mixin.Unique;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class AechorPlantRenderer extends MobRenderer<AechorPlant, AechorPlantModel> {
Expand All @@ -22,7 +23,7 @@ protected void scale(AechorPlant aechorPlant, PoseStack poseStack, float partial
}

@Override
public ResourceLocation getTextureLocation(AechorPlant aechorPlant) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return AECHOR_PLANT_TEXTURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.mojang.math.Axis;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.EntityRenderState;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;

Expand All @@ -21,6 +23,11 @@ public AerbunnyRenderer(EntityRendererProvider.Context context) {
this.addLayer(new AerbunnyCollarLayer(this, context.getModelSet()));
}

@Override
public EntityRenderState createRenderState() {
return null;
}

/**
* Scales the Aerbunny if it is a baby.
*
Expand Down Expand Up @@ -59,7 +66,7 @@ protected void setupRotations(Aerbunny aerbunny, PoseStack poseStack, float ageI
}

@Override
public ResourceLocation getTextureLocation(Aerbunny aerbunny) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return AERBUNNY_TEXTURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.aetherteam.aetherii.entity.monster.Cockatrice;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class CockatriceRenderer extends MobRenderer<Cockatrice, CockatriceModel> {
Expand All @@ -18,7 +19,7 @@ public CockatriceRenderer(EntityRendererProvider.Context context) {
}

@Override
public ResourceLocation getTextureLocation(Cockatrice aechorPlant) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return COCKATRICE_PLANT_TEXTURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.aetherteam.aetherii.entity.passive.FlyingCow;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class FlyingCowRenderer extends MobRenderer<FlyingCow, FlyingCowModel<FlyingCow>> {
Expand All @@ -16,7 +17,7 @@ public FlyingCowRenderer(EntityRendererProvider.Context context) {
}

@Override
public ResourceLocation getTextureLocation(FlyingCow flyingCow) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return FLYING_COW_TEXTURE;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.aetherteam.aetherii.entity.passive.Phyg;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class PhygRenderer extends MobRenderer<Phyg, PhygModel<Phyg>> {
Expand All @@ -16,7 +17,7 @@ public PhygRenderer(EntityRendererProvider.Context context) {
}

@Override
public ResourceLocation getTextureLocation(Phyg phyg) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return PHYG_TEXTURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
import com.aetherteam.aetherii.entity.projectile.ScatterglassBolt;
import net.minecraft.client.renderer.entity.ArrowRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.state.ArrowRenderState;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class ScatterglassBoltRenderer extends ArrowRenderer<ScatterglassBolt> {
public static final ResourceLocation SCATTERGLASS_BOLT_LOCATION = ResourceLocation.fromNamespaceAndPath(AetherII.MODID, "textures/entity/projectile/scatterglass_bolt.png");
public class ScatterglassBoltRenderer extends ArrowRenderer<ScatterglassBolt, ArrowRenderState> {
public static final ResourceLocation SCATTERGLASS_BOLT_TEXTURE = ResourceLocation.fromNamespaceAndPath(AetherII.MODID, "textures/entity/projectile/scatterglass_bolt.png");

public ScatterglassBoltRenderer(EntityRendererProvider.Context context) {
super(context);
}

public ArrowRenderState createRenderState() {
return new ArrowRenderState();
}

@Override
public ResourceLocation getTextureLocation(ScatterglassBolt bolt) {
return SCATTERGLASS_BOLT_LOCATION;
public ResourceLocation getTextureLocation(ArrowRenderState renderState) {
return SCATTERGLASS_BOLT_TEXTURE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.aetherteam.aetherii.entity.passive.Sheepuff;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.resources.ResourceLocation;

public class SheepuffRenderer extends MobRenderer<Sheepuff, SheepuffModel<Sheepuff>> {
Expand All @@ -18,7 +19,7 @@ public SheepuffRenderer(EntityRendererProvider.Context context) {
}

@Override
public ResourceLocation getTextureLocation(Sheepuff sheepuff) {
public ResourceLocation getTextureLocation(LivingEntityRenderState renderState) {
return SHEEPUFF_TEXTURE;
}
}
Loading