This commit is contained in:
Flanks255 2023-01-16 15:47:31 -06:00
parent e2fb8b12a9
commit 07a6da0948
12 changed files with 56 additions and 19 deletions

View file

@ -432,6 +432,7 @@ ef7f9a92f8b47c3de7f732172f7bb0d996b38718 assets/actuallyadditions/models/item/si
8c66fd0c6618256da1e66524ebb1261f3ec34faa assets/actuallyadditions/models/item/smooth_black_quartz_slab.json
db82f63202197fa244540886e29d283df392afee assets/actuallyadditions/models/item/smooth_black_quartz_stair.json
5c2c9f1f8d8d7a58b3aa3f66f11a85e2f649a602 assets/actuallyadditions/models/item/smooth_black_quartz_wall.json
9e857ec4a49be55e365e2390078af1d45144899c assets/actuallyadditions/models/item/snail.json
90f07fa285908351a3a486bcab320352b4697500 assets/actuallyadditions/models/item/solidified_experience.json
1ba6c5a40ec762bae26cbca11afea7a76a24f85c assets/actuallyadditions/models/item/stone_aiot.json
1905e7a72f7b8dfebbe177105540c57d9b365385 assets/actuallyadditions/models/item/teleport_staff.json
@ -450,7 +451,7 @@ a42cb031c408a93ddbf94a5b7f1b496b3cc18086 assets/actuallyadditions/models/item/vo
4309a1169749dc7b9e79ba5a37c4f4f7a8206dea assets/actuallyadditions/models/item/wings_of_the_bats.json
f68d37fcdaf57ec06518d5974cbf540e6c45d271 assets/actuallyadditions/models/item/wood_casing.json
f657eabc7321de0b05cf92d9ebdd6f5215a685b5 assets/actuallyadditions/models/item/wooden_aiot.json
7f8e5e703d9244222706c52d7b24b299e07cb2db assets/actuallyadditions/models/item/worm.json
09674f706bebd8f2631450f1c07f1376b2c3ba01 assets/actuallyadditions/models/item/worm.json
0b1ab8963077c90a5104b516eab36e56c8a07057 assets/actuallyadditions/models/item/xp_solidifier.json
ecf1cc8efe1f425334e8e07a6c747641c714c92c assets/actuallyadditions/sounds.json
b679296118ae905d4a15b6bc658cfa7b8048e57f data/actuallyadditions/loot_tables/blocks/atomic_reconstructor.json

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "actuallyadditions:item/snail"
}
}

View file

@ -2,5 +2,13 @@
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "actuallyadditions:item/worm"
}
},
"overrides": [
{
"predicate": {
"actuallyadditions:snail": 1.0
},
"model": "actuallyadditions:item/snail"
}
]
}

View file

@ -58,6 +58,16 @@ public class ItemModelGenerator extends ItemModelProvider {
generateBucket(InitFluids.REFINED_CANOLA_OIL);
generateBucket(InitFluids.CRYSTALLIZED_OIL);
generateBucket(InitFluids.EMPOWERED_OIL);
String wormpath = ActuallyItems.WORM.get().getRegistryName().getPath();
singleTexture(wormpath, mcLoc("item/handheld"), "layer0", modLoc("item/" + wormpath))
.override().predicate(new ResourceLocation(ActuallyAdditions.MODID, "snail"), 1F)
.model(singleTexture("snail", mcLoc("item/handheld"), "layer0", modLoc("item/snail"))).end();
/* withExistingParent(wormpath, mcLoc("item/handheld"))
.texture("layer0", modLoc("item/" + wormpath))
.override().predicate(new ResourceLocation(ActuallyAdditions.MODID, "snail"), 1F)
.model(getBuilder("snail").parent(getExistingFile(mcLoc("item/handheld"))).texture("layer0", "item/snail")).end();*/
}
private void generateBucket(FluidAA fluidSupplier) {

View file

@ -149,7 +149,7 @@ public class ActuallyAdditions {
}
private void clientSetup(FMLClientSetupEvent event) {
ActuallyAdditionsClient.setup();
ActuallyAdditionsClient.setup(event);
}
public void serverStarted(FMLServerStartedEvent event) {

View file

@ -19,23 +19,29 @@ import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
import de.ellpeck.actuallyadditions.mod.inventory.gui.*;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemWorm;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.network.play.ClientPlayNetHandler;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemModelsProperties;
import net.minecraft.network.play.client.CPlayerDiggingPacket;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
public class ActuallyAdditionsClient {
public static void setup() {
public static void setup(FMLClientSetupEvent event) {
ScreenManager.register(ActuallyContainers.BAG_CONTAINER.get(), GuiBag::new);
ScreenManager.register(ActuallyContainers.BIO_REACTOR_CONTAINER.get(), GuiBioReactor::new);
ScreenManager.register(ActuallyContainers.BREAKER_CONTAINER.get(), GuiBreaker::new);
@ -68,7 +74,10 @@ public class ActuallyAdditionsClient {
setupSpecialRenders();
RenderWorm.fixItemStack();// todo: remove
event.enqueueWork(() ->
ItemModelsProperties.register(ActuallyItems.WORM.get(), new ResourceLocation(ActuallyAdditions.MODID, "snail"),
(stack, world, entity) -> "snail mail".equalsIgnoreCase(stack.getHoverName().getString()) ? 1F : 0F));
setupRenderLayers();
}

View file

@ -24,6 +24,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Util;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -31,26 +32,27 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class RenderWorm extends EntityRenderer<EntityWorm> {
private static ItemStack stack = ItemStack.EMPTY;
private ItemStack stack;
private ItemStack snailStack;
public RenderWorm(EntityRendererManager p_i46179_1_) {
super(p_i46179_1_);
}
public static void fixItemStack() {
stack = new ItemStack(ActuallyItems.WORM.get());
snailStack = new ItemStack(ActuallyItems.WORM.get());
snailStack.setHoverName(new StringTextComponent("Snail Mail"));
}
@Override
public void render(EntityWorm entity, float partialTicks, float p_225623_3_, MatrixStack matrix, IRenderTypeBuffer buffer, int light) {
boolean isSnail = entity.getCustomName().getString().equalsIgnoreCase("snail mail");
matrix.pushPose();
matrix.translate(0, 0.7F, 0);
double boop = Util.getMillis() / 70D;
matrix.mulPose(Vector3f.YP.rotationDegrees(-(float) (boop % 360)));
matrix.translate(0,0,0.4);
Minecraft.getInstance().getItemRenderer().renderStatic(
stack, ItemCameraTransforms.TransformType.FIXED, light, OverlayTexture.NO_OVERLAY, matrix, buffer
isSnail? snailStack:stack, ItemCameraTransforms.TransformType.FIXED, light, OverlayTexture.NO_OVERLAY, matrix, buffer
);
matrix.popPose();

View file

@ -187,7 +187,7 @@ public final class ActuallyItems {
// The rest?
RESTONIA_CRYSTAL_SHARD, PALIS_CRYSTAL_SHARD, DIAMATINE_CRYSTAL_SHARD, VOID_CRYSTAL_SHARD, EMERADIC_CRYSTAL_SHARD,
ENORI_CRYSTAL_SHARD, ENGINEERS_GOGGLES, ENGINEERS_GOGGLES_ADVANCED, LASER_UPGRADE_RANGE, LASER_UPGRADE_INVISIBILITY,
HANDHELD_FILLER, TRAVELERS_SACK, VOID_SACK, WORM, PLAYER_PROBE, FILTER, WATER_BOWL, PAPER_CONE, DOUGH,
HANDHELD_FILLER, TRAVELERS_SACK, VOID_SACK, PLAYER_PROBE, FILTER, WATER_BOWL, PAPER_CONE, DOUGH,
RING, BASIC_COIL, ADVANCED_COIL, RICE_DOUGH, TINY_COAL, TINY_CHARCOAL, RICE_SLIMEBALL, CANOLA, EMPTY_CUP,
BATS_WING, DRILL_CORE, LENS, ENDER_STAR, CRYSTALLIZED_CANOLA_SEED, EMPOWERED_CANOLA_SEED, LENS_OF_COLOR,
LENS_OF_DETONATION, LENS_OF_CERTAIN_DEATH, LENS_OF_THE_KILLER, LENS_OF_DISENCHANTING, LENS_OF_THE_MINER,

View file

@ -27,6 +27,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor;
import java.util.List;
import java.util.Set;
@ -41,7 +42,8 @@ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles {
super(ArmorMaterials.GOGGLES, EquipmentSlotType.HEAD, ActuallyItems.defaultProps().setNoRepair().durability(0));
this.displayMobs = displayMobs;
MinecraftForge.EVENT_BUS.register(this);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> MinecraftForge.EVENT_BUS.register(this));
}
public static boolean isWearing(PlayerEntity player) {

View file

@ -17,11 +17,16 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.Util;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.UseHoeEvent;
import net.minecraftforge.eventbus.api.Event;
@ -34,12 +39,6 @@ public class ItemWorm extends ItemBase {
public ItemWorm() {
super();
//MinecraftForge.EVENT_BUS.register(this);
// TODO: [port] Not sure what this does
// this.addPropertyOverride(new ResourceLocation(ActuallyAdditions.MODID, "snail"), (IItemPropertyGetter) (stack, world, entity) -> "snail mail".equalsIgnoreCase(stack.getDisplayName().getString())
// ? 1F
// : 0F);
}
@Override
@ -53,7 +52,7 @@ public class ItemWorm extends ItemBase {
if (!context.getLevel().isClientSide) {
EntityWorm worm = new EntityWorm(ActuallyAdditions.ENTITY_WORM.get(), context.getLevel());
worm.setPos(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
worm.setCustomName(stack.getHoverName()); // TODO: WHAT DOES THIS EVEN DO?
worm.setCustomName(stack.getHoverName());
context.getLevel().addFreshEntity(worm);
if (!context.getPlayer().isCreative()) {
stack.shrink(1);