mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Compare commits
3 commits
860215e7c1
...
e2fb8b12a9
Author | SHA1 | Date | |
---|---|---|---|
|
e2fb8b12a9 | ||
|
72e29bf696 | ||
|
db9b199d76 |
17 changed files with 62 additions and 78 deletions
|
@ -7,10 +7,10 @@ mod_version=1.1.52
|
|||
|
||||
# Forge
|
||||
game_version=1.16.5
|
||||
forge_version=36.2.30
|
||||
forge_version=36.2.34
|
||||
|
||||
# Parchment (Mappings)
|
||||
parchment_version=2021.10.17
|
||||
|
||||
# Other mods
|
||||
jei_version=1.16.5:7.7.1.117
|
||||
jei_version=1.16.5:7.7.1.153
|
||||
|
|
|
@ -83,8 +83,8 @@ public class ActuallyAdditions {
|
|||
};
|
||||
public static final Logger LOGGER = LogManager.getLogger(NAME);
|
||||
|
||||
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, "entities");
|
||||
public static final RegistryObject<EntityType<EntityWorm>> ENTITY_WORM = ENTITIES.register("worm", () -> EntityType.Builder.of(EntityWorm::new, EntityClassification.CREATURE).build(MODID + ":worm"));
|
||||
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, MODID);
|
||||
public static final RegistryObject<EntityType<EntityWorm>> ENTITY_WORM = ENTITIES.register("worm", () -> EntityType.Builder.of(EntityWorm::new, EntityClassification.MISC).build(MODID + ":worm"));
|
||||
|
||||
public static boolean commonCapsLoaded;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.render.*;
|
||||
import de.ellpeck.actuallyadditions.mod.entity.EntityWorm;
|
||||
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
|
||||
import de.ellpeck.actuallyadditions.mod.entity.RenderWorm;
|
||||
import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
|
||||
|
@ -29,6 +30,7 @@ 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.javafmlmod.FMLJavaModLoadingContext;
|
||||
|
||||
public class ActuallyAdditionsClient {
|
||||
|
@ -60,7 +62,6 @@ public class ActuallyAdditionsClient {
|
|||
ScreenManager.register(ActuallyContainers.RANGED_COLLECTOR_CONTAINER.get(), GuiRangedCollector::new);
|
||||
ScreenManager.register(ActuallyContainers.XPSOLIDIFIER_CONTAINER.get(), GuiXPSolidifier::new);
|
||||
// From old proxy
|
||||
InitEntities.initClient();
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new ClientRegistryHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new SpecialRenderInit());
|
||||
|
@ -99,6 +100,8 @@ public class ActuallyAdditionsClient {
|
|||
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_ITEM.getTileEntityType(), RenderLaserRelay::new);
|
||||
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getTileEntityType(), RenderLaserRelay::new);
|
||||
ClientRegistry.bindTileEntityRenderer(ActuallyBlocks.LASER_RELAY_FLUIDS.getTileEntityType(), RenderLaserRelay::new);
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(ActuallyAdditions.ENTITY_WORM.get(), RenderWorm::new);
|
||||
}
|
||||
|
||||
// TODO: [port] validate that this works
|
||||
|
|
|
@ -68,7 +68,6 @@ public class BlockColoredLamp extends BlockBase {
|
|||
builder.add(LIT);
|
||||
}
|
||||
|
||||
// TODO: [port][test] validate this rework works
|
||||
@Override
|
||||
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
|
@ -101,33 +100,4 @@ public class BlockColoredLamp extends BlockBase {
|
|||
? 15
|
||||
: 0;
|
||||
}
|
||||
|
||||
// TODO: [port] Add this back correctly
|
||||
// public static class TheItemBlock extends ItemBlockBase {
|
||||
//
|
||||
// public TheItemBlock(Block block) {
|
||||
// super(block);
|
||||
// this.setHasSubtypes(true);
|
||||
// this.setMaxDamage(0);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getItemStackDisplayName(ItemStack stack) {
|
||||
// if (stack.getItemDamage() >= ALL_LAMP_TYPES.length) {
|
||||
// return StringUtil.BUGGED_ITEM_NAME;
|
||||
// }
|
||||
// if (Util.isClient()) {
|
||||
// return super.getItemStackDisplayName(stack) + (((BlockColoredLamp) this.block).isOn
|
||||
// ? " (" + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".onSuffix.desc") + ")"
|
||||
// : "");
|
||||
// } else {
|
||||
// return super.getItemStackDisplayName(stack);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getTranslationKey(ItemStack stack) {
|
||||
// return ActuallyBlocks.blockColoredLamp.getTranslationKey() + "_" + ALL_LAMP_TYPES[stack.getItemDamage()].regName;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -29,25 +29,4 @@ public class BlockCrystal extends ActuallyBlock {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public static class TheItemBlock extends ItemBlockBase {
|
||||
//
|
||||
// public TheItemBlock(Block block) {
|
||||
// super(block);
|
||||
// this.setHasSubtypes(true);
|
||||
// this.setMaxDamage(0);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getTranslationKey(ItemStack stack) {
|
||||
// return stack.getItemDamage() >= ALL_CRYSTALS.length
|
||||
// ? StringUtil.BUGGED_ITEM_NAME
|
||||
// : this.getTranslationKey() + "_" + ALL_CRYSTALS[stack.getItemDamage()].name;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean hasEffect(ItemStack stack) {
|
||||
// return this.block instanceof BlockCrystal && ((BlockCrystal) this.block).isEmpowered;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -42,6 +42,11 @@ public class ColorChangeRecipe implements IRecipe<IInventory> {
|
|||
return input.test(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack assemble(@Nonnull IInventory pInv) {
|
||||
|
|
|
@ -56,6 +56,11 @@ public class CrushingRecipe implements IRecipe<IInventory> {
|
|||
return input.test(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack assemble(@Nonnull IInventory pInv) {
|
||||
|
|
|
@ -79,6 +79,11 @@ public class EmpowererRecipe implements IRecipe<IInventory> {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack assemble(@Nonnull IInventory pInv) {
|
||||
|
|
|
@ -80,6 +80,11 @@ public class FermentingRecipe implements IRecipe<IInventory> {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack assemble(IInventory pInv) {
|
||||
|
|
|
@ -57,6 +57,11 @@ public class LaserRecipe implements IRecipe<IInventory> {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(IInventory pInv) {
|
||||
return result.copy();
|
||||
|
|
|
@ -59,6 +59,11 @@ public class LiquidFuelRecipe implements IRecipe<IInventory> {
|
|||
return this.fuel.isFluidEqual(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getFuelAmount() {
|
||||
return this.fuel.getAmount();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,11 @@ public class MiningLensRecipe extends WeightedRandom.Item implements IRecipe<IIn
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack assemble(IInventory pInv) {
|
||||
|
|
|
@ -38,6 +38,11 @@ public class PressingRecipe implements IRecipe<IInventory> {
|
|||
return input.test(pInv.getItem(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(IInventory pInv) {
|
||||
return ItemStack.EMPTY;
|
||||
|
|
|
@ -45,6 +45,11 @@ public class SolidFuelRecipe implements IRecipe<SingleItem> {
|
|||
return this.itemIngredient.test(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(SingleItem pInv) {
|
||||
return ItemStack.EMPTY;
|
||||
|
|
|
@ -17,11 +17,13 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.play.server.SSpawnObjectPacket;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
|
||||
public class EntityWorm extends Entity {
|
||||
|
||||
|
@ -128,6 +130,6 @@ public class EntityWorm extends Entity {
|
|||
|
||||
@Override
|
||||
public IPacket<?> getAddEntityPacket() {
|
||||
return null;
|
||||
return NetworkHooks.getEntitySpawningPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack;
|
|||
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.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
|
@ -46,9 +47,8 @@ public class RenderWorm extends EntityRenderer<EntityWorm> {
|
|||
|
||||
matrix.translate(0, 0.7F, 0);
|
||||
double boop = Util.getMillis() / 70D;
|
||||
matrix.mulPose(new Quaternion(-(float) (boop % 360), 0, 1, 0));
|
||||
|
||||
// stack.getDisplayName()
|
||||
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
|
||||
);
|
||||
|
@ -56,21 +56,6 @@ public class RenderWorm extends EntityRenderer<EntityWorm> {
|
|||
matrix.popPose();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
// GlStateManager.pushMatrix();
|
||||
// this.bindEntityTexture(entity);
|
||||
// GlStateManager.translate(x, y + 0.7F, z);
|
||||
// double boop = Minecraft.getSystemTime() / 70D;
|
||||
// GlStateManager.rotate(-(float) (boop % 360), 0, 1, 0);
|
||||
// GlStateManager.translate(0, 0, 0.4);
|
||||
//
|
||||
// stack.setStackDisplayName(entity.getName());
|
||||
// AssetUtil.renderItemInWorld(stack, combinedLightIn, combinedOverlayIn, matrices, buffer);
|
||||
//
|
||||
// GlStateManager.popMatrix();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureLocation(EntityWorm pEntity) {
|
||||
return PlayerContainer.BLOCK_ATLAS;
|
||||
|
|
Loading…
Reference in a new issue