Jump to content

Meldexun

Members
  • Posts

    184
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Meldexun's Achievements

Creeper Killer

Creeper Killer (4/8)

6

Reputation

  1. So i want to render a water texture when there is no block near my block. Currently i have a TileEntitySpecialRenderer which renders a block of water at the position of my block. But when the it renders the model of my block is hidden. I mean when standing inside the block i can see the model and the water but from the outside i can only see the water. That's the TileEntitySpecialRenderer : And a pictures how it currently looks like:
  2. Hello, I have a moving sound but i'm wondering how to correctly start it and restart/resume it when it's stopped. Currently i have this: @SubscribeEvent public static void updateUnderwaterAmbience(ClientTickEvent event) { if (event.phase == Phase.START) { Minecraft mc = Minecraft.getMinecraft(); if (mc.world != null) { SoundHandler soundHandler = mc.getSoundHandler(); if (!soundHandler.isSoundPlaying(SoundEventHandler.underwaterSound)) { SoundEventHandler.underwaterSound = new UnderwaterAmbientSound(mc.player); soundHandler.playSound(SoundEventHandler.underwaterSound); } } } }
  3. Well that's 1.12.2 not 1.10.2. Also when lowercasing the names of the fields it works as well as annotating the fields but leaving them uppercase doesn't work.
  4. Probably naming the fields with lowercase letters is the key. But i already added an ObjectHolder annotation to my fields so i will stay with that.
  5. After some testing it seems like i have to annotate every field with @ObjectHolder. Also looking at Choonster's TestMod3 i saw that he also annotated every field.
  6. Sure. Here it is: @ObjectHolder(BetterDiving.MOD_ID) public class ModItems { public static final Item TITANIUM = null; public static final Item COPPER_ORE = null; public static final Item SILVER_ORE = null; public static final Item LEAD = null; public static final Item GOLD = null; @EventBusSubscriber public static class ItemRegistrationHandler { public static final List<Item> ITEMS = new ArrayList<Item>(); @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { final Item[] items = { setItemName(new Item(), "titanium"), setItemName(new Item(), "copper_ore"), setItemName(new Item(), "silver_ore"), setItemName(new Item(), "lead"), setItemName(new Item(), "gold") }; IForgeRegistry<Item> registry = event.getRegistry(); for (Item item : items) { registry.register(item); ITEMS.add(item); } } private static Item setItemName(Item item, String name) { return setItemNameAndTab(item, name, BetterDiving.TAB_BETTER_DIVING); } private static Item setItemNameAndTab(Item item, String name, @Nullable CreativeTabs tab) { return item.setUnlocalizedName(name).setRegistryName(BetterDiving.MOD_ID, name).setCreativeTab(tab); } } }
  7. Hello, I annotated my items class with @ObjectHolder(MOD_ID). But it isn't injecting the item objects into the fields. Does the ObjectHolder annotation only work for classes as of 1.12.2?
  8. Hello, I have an item and i attach a ItemStackHandler capability to it. But i have some weird behaviour going on when using it in creative mode (it's a creative mode only item...). Duplication: 1. Right click to open the inventory, place items inside and close it. 2. Right click again to open the inventory, take the items and close it. 3. Press E to open the normal inventory and drop the item to the world. (only when dropping from creative inventory) 4. Pick up the item and open the inventory. 5. You will find the items in it again... Deletion: 1. Right click to open the inventory, place items inside and close it. 2. Press E to open the normal inventory and drop the item to the world. (only when dropping from creative inventory) 3. Pick up the item and open the inventory. 4. You will find no items in it... Github: https://github.com/Meldexun/ChocolateQuestRepoured/tree/master/src/main/java/com/teamcqr/chocolatequestrepoured Direct links to classes on github: Item class: ItemBadge.java Capability provider class: CapabilityItemStackHandlerProvider.java Gui handler class: GuiHandler.java Container class: ContainerBadge.java Gui class: GuiBadge.java Thank you in advance for your help.
  9. Iirc in 1.12.2 there is an item limit and you still recommend creating 20 items. Can't this cause issues? I thought only in MC 1.13 and newer i should create 20 items.
  10. Yeah i knew how it works with blockstates but i thought it may also work with items. So i just registered a item model with the metadata of 16 and it seems to work ingame. This is what i have done: @SubscribeEvent public static void registerItemModels(ModelRegistryEvent event) { registerCustomItemModel(ModItems.DUNGEON_PLACER, 16, ModItems.DUNGEON_PLACER.getRegistryName().toString() + "_d" + 16, "inventory"); } private static void registerCustomItemModel(Item item, int meta, String modelLocation, String variant) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(modelLocation, variant)); } Is there any reason not to do this?
  11. Hello, So i basically want to create a item with 20 different models. 1. First of all when creating a ModelResourceLocation what is the use of the variant parameter (when registering a item model)? 2. I have a capability added to my item. Can i somehow change the model of the item depending on the capability? The meta won't really work because i need more than 16 models.
  12. I want every 5 seconds to randomly rotate my entity. So i added this to my entity class: @Override public void onUpdate() { if (!world.isRemote && world.getTotalWorldTime() % 100 == 0) { this.rotationYaw = world.rand.nextFloat() * 360F; } System.out.println(this.rotationYaw); } But the problem is that the rotation is not synced correctly with the client. It gives me 2 different rotations. Any idea why it doesn't sync correcly?
  13. Guess i will make 4 recipes for now since i want to make a custom workbench in the future. Thanks for the help.
  14. Hi there, I want to add a recipe for a custom item. To craft it you need a titanium ingot and a silver ingot. But i also want that you can use a ore instead of a ingot. So how can i achieve that? Do i have to make 4 recipes (1: t-ingot and s-ingot, 2: t-ore and s-ingot, 3: t-ingot and s-ore, 4: t-ore and s-ore)?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.