Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

AccessTransfomers - can't get it to work


Recommended Posts

Using the tutorial's AccessTransformer:

 

package il.steamcraft.asm;

import java.io.IOException;
import java.lang.reflect.Method;

import cpw.mods.fml.common.asm.transformers.AccessTransformer;

public class SteamcraftAccessTransformer extends AccessTransformer
{
private static SteamcraftAccessTransformer instance;

public SteamcraftAccessTransformer() throws IOException
{
	super();
	instance = this;
	this.readMapFile("Steamcraft_at.cfg");
}

private void readMapFile(String name)
{
	System.out.println("Steamcraft Transformer Map: "+name);
	try
	{
		Method e = AccessTransformer.class.getDeclaredMethod("readMapFile", new Class[]{String.class});
		e.setAccessible(true);
		e.invoke(this, new Object[]{name});
	}
	catch(Exception ex)
	{
		throw new RuntimeException(ex);
	}
}
}

 

And I'm using the basic stuff: LoadingPlugin and DummyContainer.

I have execluded for Eclipse to run the transformer, but I have exported it and it loads fine.

I'm using the following Steamcraft_at.cfg :

#World
public aab.E #FD:World/field_72985_G #spawnHostileMobs

 

Its for testing purposes, and I can't get it to work. Just results in a crash when I try to change the spawnHostileMobs in the DummyContainer

@Subscribe
public void onServerStarting(FMLServerStartingEvent ev) {
        ev.getServer().worldServerForDimension(0).spawnHostileMobs = false;    
}

 

Crashlog:

2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_ABOUT_TO_START to SERVER_STOPPED. Loading cannot continue
2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] 
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{5.1.28.659} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{7.7.1.659} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SCASM{SC0.3} [steamcraft ASM] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
SC{SC0.3} [steamcraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-04-19 22:47:12 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:800)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

I have checked and yes, when I remove the code of the hostileMobs it works fine.

So whats the problem over here ?

 

EDIT: Forgot this crashlog:

2013-04-20 00:58:05 [sEVERE] [ForgeModLoader] A fatal exception occurred during the server starting event
java.lang.Error: Unresolved compilation problem: 
The field World.spawnHostileMobs is not visible

at il.steamcraft.asm.SteamcraftContainer.onServerStarting(SteamcraftContainer.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.serverStarting(Loader.java:739)
at cpw.mods.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:314)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

As you can see, it dosen't apply towards the spawnHostileMobs and I can't understand why.

 

Also the code executes the Steamcraft_at.cfg :

2013-04-19 22:47:04 [iNFO] [sTDOUT] Reading mapFile Steamcraft_at.cfg

Link to post
Share on other sites

Using the tutorial's AccessTransformer:

 

package il.steamcraft.asm;

import java.io.IOException;
import java.lang.reflect.Method;

import cpw.mods.fml.common.asm.transformers.AccessTransformer;

public class SteamcraftAccessTransformer extends AccessTransformer
{
private static SteamcraftAccessTransformer instance;

public SteamcraftAccessTransformer() throws IOException
{
	super();
	instance = this;
	this.readMapFile("Steamcraft_at.cfg");
}

private void readMapFile(String name)
{
	System.out.println("Steamcraft Transformer Map: "+name);
	try
	{
		Method e = AccessTransformer.class.getDeclaredMethod("readMapFile", new Class[]{String.class});
		e.setAccessible(true);
		e.invoke(this, new Object[]{name});
	}
	catch(Exception ex)
	{
		throw new RuntimeException(ex);
	}
}
}

 

And I'm using the basic stuff: LoadingPlugin and DummyContainer.

I have execluded for Eclipse to run the transformer, but I have exported it and it loads fine.

I'm using the following Steamcraft_at.cfg :

#World
public aab.E #FD:World/field_72985_G #spawnHostileMobs

 

Its for testing purposes, and I can't get it to work. Just results in a crash when I try to change the spawnHostileMobs in the DummyContainer

@Subscribe
public void onServerStarting(FMLServerStartingEvent ev) {
        ev.getServer().worldServerForDimension(0).spawnHostileMobs = false;    
}

 

Crashlog:

2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_ABOUT_TO_START to SERVER_STOPPED. Loading cannot continue
2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] 
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{5.1.28.659} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{7.7.1.659} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SCASM{SC0.3} [steamcraft ASM] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
SC{SC0.3} [steamcraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
2013-04-19 22:47:12 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-04-19 22:47:12 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:800)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530)
2013-04-19 22:47:12 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

I have checked and yes, when I remove the code of the hostileMobs it works fine.

So whats the problem over here ?

 

EDIT: Forgot this crashlog:

2013-04-20 00:58:05 [sEVERE] [ForgeModLoader] A fatal exception occurred during the server starting event
java.lang.Error: Unresolved compilation problem: 
The field World.spawnHostileMobs is not visible

at il.steamcraft.asm.SteamcraftContainer.onServerStarting(SteamcraftContainer.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.serverStarting(Loader.java:739)
at cpw.mods.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:314)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

As you can see, it dosen't apply towards the spawnHostileMobs and I can't understand why.

 

Also the code executes the Steamcraft_at.cfg :

2013-04-19 22:47:04 [iNFO] [sTDOUT] Reading mapFile Steamcraft_at.cfg

Link to post
Share on other sites

 

Mhm. Mhm-..

 

I'm just asking why is the transformer dosen't work, the code seems to be okay and I'm just testing some stuff.

In one of my progress that I have deleted I had a problem with the AccessTransformer, and I couldn't get it to work properly.

It has loaded the cfg and evertyhing, I have withdrawed the code from the srg file but it didn't transform it to a public insted of a protected.

I'm just trying to understand why the code isn't effected.

Link to post
Share on other sites

 

Mhm. Mhm-..

 

I'm just asking why is the transformer dosen't work, the code seems to be okay and I'm just testing some stuff.

In one of my progress that I have deleted I had a problem with the AccessTransformer, and I couldn't get it to work properly.

It has loaded the cfg and evertyhing, I have withdrawed the code from the srg file but it didn't transform it to a public insted of a protected.

I'm just trying to understand why the code isn't effected.

Link to post
Share on other sites

I believe you have to actually change the visibility of spawnHostileMobs to public in the minecraft code. The tutorial says this:

 

On the line where it says 'spawnHostileMobs', there'll be an error. Choose the first option in the box that pops up when you hover over it.

 

I believe that the first option in the box that pops up changes spawnHostileMobs from private to public.

 

Can someone clarify? I've been confused by this too. Thanks!

Link to post
Share on other sites

I believe you have to actually change the visibility of spawnHostileMobs to public in the minecraft code. The tutorial says this:

 

On the line where it says 'spawnHostileMobs', there'll be an error. Choose the first option in the box that pops up when you hover over it.

 

I believe that the first option in the box that pops up changes spawnHostileMobs from private to public.

 

Can someone clarify? I've been confused by this too. Thanks!

Link to post
Share on other sites

I believe you have to actually change the visibility of spawnHostileMobs to public in the minecraft code. The tutorial says this:

 

On the line where it says 'spawnHostileMobs', there'll be an error. Choose the first option in the box that pops up when you hover over it.

 

I believe that the first option in the box that pops up changes spawnHostileMobs from private to public.

 

Can someone clarify? I've been confused by this too. Thanks!

 

Thats for the MCP only as I understand, cause it should work without it.

I saw the ChickenBone's AccessTransformer I don't understand how he did it. but the mod makers just need to use it and it should work.

But how, I have no idea ..

Link to post
Share on other sites

I believe you have to actually change the visibility of spawnHostileMobs to public in the minecraft code. The tutorial says this:

 

On the line where it says 'spawnHostileMobs', there'll be an error. Choose the first option in the box that pops up when you hover over it.

 

I believe that the first option in the box that pops up changes spawnHostileMobs from private to public.

 

Can someone clarify? I've been confused by this too. Thanks!

 

Thats for the MCP only as I understand, cause it should work without it.

I saw the ChickenBone's AccessTransformer I don't understand how he did it. but the mod makers just need to use it and it should work.

But how, I have no idea ..

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I have a problem about my game keep crashing because of my code. Code: package net.flexstudios.armorytests.items; import com.google.common.collect.Multimap; import net.minecraft.entity.ai.attributes.Attribute; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.Attributes; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.*; public class PoweredChestplateItem extends ArmorItem { public PoweredChestplateItem(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType equipmentSlot) { Multimap<Attribute, AttributeModifier> result = super.getAttributeModifiers(equipmentSlot); result.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Armor dmg", (double)4, AttributeModifier.Operation.ADDITION)); return result; } } A part of the crashing report: Description: Initializing game java.lang.UnsupportedOperationException: null at com.google.common.collect.ImmutableMultimap.put(ImmutableMultimap.java:427) ~[guava-21.0.jar:?] {} at com.jerrylu086.createarsenal.items.ExoframeItem.func_111205_h(ExoframeItem.java:19) ~[?:mc1.16-b1.0.0] {re:classloading} at net.minecraftforge.common.extensions.IForgeItem.getAttributeModifiers(IForgeItem.java:77) ~[?:?] {re:classloading} at net.minecraft.item.ItemStack.func_111283_C(ItemStack.java:844) ~[?:?] {re:classloading} at net.minecraft.item.ItemStack.func_82840_a(ItemStack.java:614) ~[?:?] {re:classloading} at net.minecraft.client.Minecraft.lambda$populateSearchTreeManager$7(Minecraft.java:642) ~[?:?]  
    • Done..... https://github.com/DefDaemon/Daemons_Horror_Moon Thnx for the advise
    • First of all, do not use @OnlyIn. The Callable must be in a separate class.
    • Can you explain better? This is my class where i register the blocks and relative itemblocks: package com.ike.tenchest; import com.ike.tenchest.basechest.BaseChestItemStackRenderer; import com.ike.tenchest.colossalchest.ColossalChest; import com.ike.tenchest.colossalchest.ColossalChestPart; import com.ike.tenchest.drillchest.DrillChest; import com.ike.tenchest.invisiblechest.InvisibleChest; import com.ike.tenchest.lootchest.LootChest; import com.ike.tenchest.lootchest.LootChestTileEntity; import com.ike.tenchest.minichest.MiniChest; import com.ike.tenchest.monsterchest.MonsterChest; import com.ike.tenchest.pitfallchest.PitfallChest; import com.ike.tenchest.pocketdimensionchest.PocketDimensionChest; import com.ike.tenchest.pocketdimensionchest.PocketDimensionChestTileEntity; import com.ike.tenchest.smeltingchest.SmeltingChest; import com.ike.tenchest.smeltingchest.SmeltingChestTileEntity; import com.ike.tenchest.teleportchest.TeleportChest; import com.ike.tenchest.teleportchest.TeleportChestTileEntity; import com.ike.tenchest.trapchest.TrapChest; import net.minecraft.block.Block; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.tileentity.ChestTileEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.IModBusEvent; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import java.util.concurrent.Callable; import java.util.function.Function; import java.util.function.Supplier; /** * @author Ike * @version 1.0A **/ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class Blocks implements IModBusEvent { public static final DeferredRegister<Block> BLOCKS; public static final DeferredRegister<Item> ITEMS; public static final RegistryObject<MiniChest> MINI_CHEST; public static final RegistryObject<SmeltingChest> SMELTING_CHEST; public static final RegistryObject<InvisibleChest> INVISIBLE_CHEST; public static final RegistryObject<TrapChest> TRAP_CHEST; public static final RegistryObject<PitfallChest> PITFALL_CHEST; public static final RegistryObject<DrillChest> DRILL_CHEST; public static final RegistryObject<TeleportChest> TELEPORT_CHEST; public static final RegistryObject<LootChest> LOOT_CHEST; public static final RegistryObject<MonsterChest> MONSTER_CHEST; public static final RegistryObject<PocketDimensionChest> POCKET_DIMENSION_CHEST; public static final RegistryObject<ColossalChest> COLOSSAL_CHEST; public static final RegistryObject<ColossalChestPart> COLOSSAL_CHEST_PART; static { BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, TenChest.MODID); ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, TenChest.MODID); MINI_CHEST = register("mini_chest", MiniChest::new, Blocks::baseChestRenderer); SMELTING_CHEST = register("smelting_chest", SmeltingChest::new, Blocks::smeltingChestRenderer); INVISIBLE_CHEST = register("invisible_chest", InvisibleChest::new, Blocks::baseChestRenderer); TRAP_CHEST = register("trap_chest", TrapChest::new, Blocks::baseChestRenderer); PITFALL_CHEST = register("pitfall_chest", PitfallChest::new, Blocks::baseChestRenderer); DRILL_CHEST = register("drill_chest", DrillChest::new, Blocks::baseChestRenderer); TELEPORT_CHEST = register("teleport_chest", TeleportChest::new, Blocks::teleportChestRenderer); LOOT_CHEST = register("loot_chest", LootChest::new, Blocks::lootChestRenderer); MONSTER_CHEST = register("monster_chest", MonsterChest::new, Blocks::baseChestRenderer); POCKET_DIMENSION_CHEST = register("pocket_dimension_chest", PocketDimensionChest::new, Blocks::pocketDimensionChestRenderer); COLOSSAL_CHEST_PART = register("colossal_chest_part", ColossalChestPart::new); COLOSSAL_CHEST = register("colossal_chest", ColossalChest::new, Blocks::baseChestRenderer); } @OnlyIn(Dist.CLIENT) private static Callable<ItemStackTileEntityRenderer> baseChestRenderer() { return () -> new BaseChestItemStackRenderer(ChestTileEntity::new); } @OnlyIn(Dist.CLIENT) private static Callable<ItemStackTileEntityRenderer> smeltingChestRenderer() { return () -> new BaseChestItemStackRenderer(SmeltingChestTileEntity::new); } @OnlyIn(Dist.CLIENT) private static Callable<ItemStackTileEntityRenderer> teleportChestRenderer() { return () -> new BaseChestItemStackRenderer(TeleportChestTileEntity::new); } @OnlyIn(Dist.CLIENT) private static Callable<ItemStackTileEntityRenderer> lootChestRenderer() { return () -> new BaseChestItemStackRenderer(LootChestTileEntity::new); } @OnlyIn(Dist.CLIENT) private static Callable<ItemStackTileEntityRenderer> pocketDimensionChestRenderer() { return () -> new BaseChestItemStackRenderer(PocketDimensionChestTileEntity::new); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Supplier<Callable<ItemStackTileEntityRenderer>> renderMethod) { return register(name, sup, (block) -> item(block, renderMethod)); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup) { return register(name, sup, (block) -> item(block)); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) { RegistryObject<T> ret = registerNoItem(name, sup); ITEMS.register(name, (Supplier) itemCreator.apply(ret)); return ret; } private static <T extends Block> RegistryObject<T> registerNoItem(String name, Supplier<? extends T> sup) { return BLOCKS.register(name, sup); } private static Supplier<BlockItem> item(RegistryObject<? extends Block> block, Supplier<Callable<ItemStackTileEntityRenderer>> renderMethod) { return () -> { BlockItem blockItem = new BlockItem(block.get(), (new Item.Properties().tab(TenChest.MOD_GROUP).setISTER(renderMethod))); return blockItem; }; } private static Supplier<BlockItem> item(RegistryObject<? extends Block> block) { return () -> new BlockItem(block.get(), (new Item.Properties()));//.tab(TenChest.MOD_GROUP))); } } How can i separate the process between server and client?
    • The setISTER method takes a Supplier<Callable>. The Callable should be implemented in a separate class to prevent loading it on the server.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.