Differentiation
Members-
Posts
606 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Differentiation
-
Hey, Is there any way to cancel player's knockback? Perhaps some event I need to cancel? Thanks!
-
[1.12.2] Custom Message on Player Join [SOLVED]
Differentiation replied to ModMCdl's topic in Modder Support
I'm using EntityJoinWorldEvent. -
[1.12.2] Custom Message on Player Join [SOLVED]
Differentiation replied to ModMCdl's topic in Modder Support
1 Check if the entity instance is an EntityPlayer. 2 Check for client side. 3 What Jabelar said, too. -
[1.12.2] Registering Items and Blocks?
Differentiation replied to Differentiation's topic in Modder Support
So it's just as simple as this?: @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(block1, block2, ...); } -
Hey! So I recently updated my mod to 1.12.2. Now, I know there is this new efficient way of registering Items and Blocks via the Registry Events, but I'm not too sure how you do that... This is what I currently have: public static void registerItem(Item item) { item.setCreativeTab(Dinocraft.ITEMS); ForgeRegistries.ITEMS.register(item); Utils.getLogger().info("Registered item: " + item.getUnlocalizedName().substring(5)); } public static void registerRender(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, item.getUnlocalizedName().substring(5)), "inventory")); Utils.getLogger().info("Registered render for " + item.getUnlocalizedName().substring(5)); } public static void register() { //Food registerItem(POTATOSHROOM_PIE); registerItem(CHUNKY_FLESH); //Material registerItem(CHLOROPHYTE_INGOT); registerItem(FLOBBER_INGOT); registerItem(SHEEPLITE_INGOT); registerItem(PEBBLES); registerItem(CRACKED_PEBBLES); registerItem(LEAF); registerItem(BLEVENT_INGOT); registerItem(RANIUM); registerItem(PEBBELONEUM); //? registerItem(TUSKERERS_HEART); registerItem(TUSKERERS_CHARM); //WIP registerItem(VINE_BALL); registerItem(SLINGSHOT); registerItem(VINE_BALL_BUNDLE); registerItem(POISON_BALL); registerItem(POISON_BEATLER); registerItem(RAY_BULLET); registerItem(RAY_GUN); } public static void registerRenders() { //Food registerRender(POTATOSHROOM_PIE); registerRender(CHUNKY_FLESH); //Material registerRender(CHLOROPHYTE_INGOT); registerRender(FLOBBER_INGOT); registerRender(SHEEPLITE_INGOT); registerRender(PEBBLES); registerRender(CRACKED_PEBBLES); registerRender(LEAF); registerRender(BLEVENT_INGOT); registerRender(RANIUM); registerRender(PEBBELONEUM); //? registerRender(TUSKERERS_HEART); registerRender(TUSKERERS_CHARM); //WIP registerRender(VINE_BALL); registerRender(SLINGSHOT); registerRender(VINE_BALL_BUNDLE); registerRender(POISON_BALL); registerRender(POISON_BEATLER); registerRender(RAY_BULLET); registerRender(RAY_GUN); } I mean this works and does the job perfectly fine, but I heard that the recommended way of registering it is by using the registry events. Any help is welcome. Thanks!
-
I'm having difficulty learning to mod for 1.12
Differentiation replied to Catwolf's topic in Modder Support
Ah yes. You could still follow the 1.10.2 tutorials but just change the registration for items, blocks, entities, etc. to the registry events. -
Player Capabilities on Server
Differentiation replied to VeryBadAtJavaHalp's topic in Modder Support
Correct. Do a null check for the armorItemInSlot(...) in whatever slots you want and then compare it to an armor item to check for. Done. -
[1.12.2] [SOLVED] Checking if a player is OP?
Differentiation replied to Differentiation's topic in Modder Support
PlayerList::canSendCommands(GameProfile... profile) -
Hey! What is the way to check if a player is opped to a certain permission level? I have tried to figure this out but I couldn't. Any suggestions are welcome. Thanks!
-
Hey! So in ClientChatRecievedEvent, once a player name is present in a received message, is there any way to get the EntityPlayer instance from the player name String? Is there any way to get the EntityPlayer instance in ClientChatRecievedEvent at all? Should I use a different Event? Any suggestions are welcome. Thank you!
-
PatronaMC ||| HARRY POTTER ||| Looking for Staff and builders |||
Differentiation replied to Jupiiterr's topic in Servers
Cool! -
[1.12.2] Test if Inventory contains multiple Items
Differentiation replied to BrainFace's topic in Modder Support
Purge the page (reload) -
[1.12.2] Test if Inventory contains multiple Items
Differentiation replied to BrainFace's topic in Modder Support
List<ItemStack> items = new ArrayList<ItemStack>(); for (int i = 0; i < tile.getInventory().getSlots(); ++i) { if (!tile.getItem().getStackInSlot(i).isEmpty()) { items.add(tile.getItem().getStackInSlot(i)); } } if (items.containsAll(recipe.catalysator)) { } -
[1.12.2] Test if Inventory contains multiple Items
Differentiation replied to BrainFace's topic in Modder Support
List<ItemStack> items = new ArrayList<ItemStack>(); for (int i = 0; i < tile.getInventory().getSlots(); i++){ if (!tile.getItem().getStackInSlot(i).isEmpty()){ items.add(tile.getItem().getStackInSlot(i)); } } if (items.containsAll(recipe.catalysator)) { // TODO } -
I'm pretty sure we do Java here, not other Programming Languages