Jump to content

[1.8] [UNSOLVED] 3D Smart Item Model is Textured with the Sprite Atlas?


Sgmjscorp

Recommended Posts

Firstly, for anyone wondering, forge version: 1.8-11.14.3.1521

 

 

l4jwFVn.png

 

 

oycVwER.png

 

 

XXJZRw9.png

 

 

PO6QeI8.png

 

 

 

package com.scors.bioalchemy.render;

import java.util.ArrayList;
import java.util.List;

import com.scors.bioalchemy.BioAlchemy;
import com.scors.bioalchemy.render.ModelMapper.CannonPart;

import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IFlexibleBakedModel;
import net.minecraftforge.client.model.ISmartItemModel;

public class ArmCannonSmartModel implements ISmartItemModel {

private IBakedModel base;
private IFlexibleBakedModel chase;

public static ModelResourceLocation mrl = new ModelResourceLocation(BioAlchemy.modid+":armcannon", "inventory");

public ArmCannonSmartModel(IBakedModel base)
{
	this.base = base;
}

@Override
public IBakedModel handleItemState(ItemStack stack) {
	if(stack != null)
	{
		NBTTagCompound tag = stack.getTagCompound();
		if(tag == null){
			chase = ModelMapper.getBaked(CannonPart.CHASE, "defaultchase");
		}
	}
	return this;
}

@Override
public List getFaceQuads(EnumFacing p_177551_1_) {
	// TODO Auto-generated method stub
	return base.getFaceQuads(p_177551_1_);
}

@Override
public List getGeneralQuads() {
	// TODO Auto-generated method stub
	return chase.getGeneralQuads();
}

@Override
public boolean isAmbientOcclusion() {
	// TODO Auto-generated method stub
	return base.isAmbientOcclusion();
}

@Override
public boolean isGui3d() {
	// TODO Auto-generated method stub
	return base.isGui3d();
}

@Override
public boolean isBuiltInRenderer() {
	// TODO Auto-generated method stub
	return false;
}

@Override
public TextureAtlasSprite getTexture() {
	// TODO Auto-generated method stub
	return base.getTexture();
}

@Override
public ItemCameraTransforms getItemCameraTransforms() {
	// TODO Auto-generated method stub
	return base.getItemCameraTransforms();
}

}

 

 

Images and title says it all.  For some reason, my Smart Item Model class is no longer rendering the proper textures, and I believe it is related to the forge update to version 1519.  Attached is the class code, and the only real change is getGeneralQuads() can be changed from chase to base and it'll render the base properly.  (Both have identical JSon's so I know it's not the JSON itself.)

In the images, the left is the chase and the right is the smart item.

 

If anyone has any idea what I can do to fix/work-around this it would be greatly appreciated!  Thank you!

Link to comment
Share on other sites

All of those

// TODO Auto-generated method stub

might be the problem.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I think you should show relevant code with this line:

ModelMapper.getBaked(CannonPart.CHASE, "defaultchase")

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

All of those

// TODO Auto-generated method stub

might be the problem.

Those are generated by Eclipse when bringing in methods from an interface/super/etc.  They're considered comments by java's code.

 

I think you should show relevant code with this line:

ModelMapper.getBaked(CannonPart.CHASE, "defaultchase")

 

This just grabs the recorded baked model of the part, this case being the chase.  It's returning a model, I know that much, but here's the ModelMapper and Event manager classes.

 

ModelMapper:

 

package com.scors.bioalchemy.render;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

import com.scors.bioframe.elements.extended.ElementExtendedFrame;

import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.model.IFlexibleBakedModel;

public class ModelMapper {

public enum CannonPart { 
	CHASE("chases/"),
	REINFORCE("reinforces/"),
	CHAMBER("chambers/"),
	EXTRA("extras/");

	public final String file;
	CannonPart(String file)
	{
		this.file = file;
	}
}

private static HashMap<String, ModelResourceLocation> chases = new HashMap<String, ModelResourceLocation>();
private static HashMap<String, IFlexibleBakedModel> chasesBaked = new HashMap<String, IFlexibleBakedModel>();
private static HashMap<String, Vec3> chaseOffsets = new HashMap<String, Vec3>();
private static HashMap<String, Float> chaseScales = new HashMap<String, Float>();
private static HashMap<String, ElementExtendedFrame> chaseNatives = new HashMap<String, ElementExtendedFrame>();

private static HashMap<String, ModelResourceLocation> reinforces = new HashMap<String, ModelResourceLocation>();
private static HashMap<String, IFlexibleBakedModel> reinforcesBaked = new HashMap<String, IFlexibleBakedModel>();
private static HashMap<String, Vec3[]> reinforceOffsets = new HashMap<String, Vec3[]>();
private static HashMap<String, Float> reinforceScales = new HashMap<String, Float>();
private static HashMap<String, ElementExtendedFrame> reinforceNatives = new HashMap<String, ElementExtendedFrame>();

private static HashMap<String, ModelResourceLocation> chambers = new HashMap<String, ModelResourceLocation>();
private static HashMap<String, IFlexibleBakedModel> chambersBaked = new HashMap<String, IFlexibleBakedModel>();
private static HashMap<String, Vec3> chamberOffsets = new HashMap<String, Vec3>();
private static HashMap<String, Float> chamberScales = new HashMap<String, Float>();
private static HashMap<String, ElementExtendedFrame> chamberNatives = new HashMap<String, ElementExtendedFrame>();

private static HashMap<String, ModelResourceLocation> extras = new HashMap<String, ModelResourceLocation>();
private static HashMap<String, IFlexibleBakedModel> extrasBaked = new HashMap<String, IFlexibleBakedModel>();
private static HashMap<String, Vec3> extraOffsets = new HashMap<String, Vec3>();
private static HashMap<String, Float> extraScales = new HashMap<String, Float>();
private static HashMap<String, ElementExtendedFrame> extraNatives = new HashMap<String, ElementExtendedFrame>();

public static void addUnbaked(CannonPart part, String name, ModelResourceLocation mrl)
{
	switch(part)
	{
	case CHASE:{
		if(chases.containsKey(name)){return;}
		chases.put(name, mrl);
		break;
	}
	case CHAMBER:{
		if(chambers.containsKey(name)){return;}
		chambers.put(name, mrl);
		break;
	}
	case REINFORCE:{
		if(reinforces.containsKey(name)){return;}
		reinforces.put(name, mrl);
		break;
	}
	case EXTRA:{
		if(extras.containsKey(name)){return;}
		extras.put(name, mrl);
		break;
	}
	default:
		break;
	}
}

public static ModelResourceLocation getUnbaked(CannonPart part, String name)
{
	switch(part)
	{
	case CHASE:{
		return chases.get(name);
	}
	case REINFORCE:{
		return reinforces.get(name);
	}
	case CHAMBER:{
		return chambers.get(name);
	}
	case EXTRA:{
		return extras.get(name);
	}
	default:
		return null;
	}
}

public static Set<String> getKeys(CannonPart part) {
	switch(part)
	{
	case CHAMBER:
		return chambers.keySet();
	case CHASE:
		return chases.keySet();
	case EXTRA:
		return extras.keySet();
	case REINFORCE:
		return reinforces.keySet();
	default:
		return null;
	}
}

public static void addBaked(CannonPart part, String name, IFlexibleBakedModel ifbm)
{
	switch(part)
	{
	case CHAMBER:{
		if(chambersBaked.containsKey(name)){return;}
		chambersBaked.put(name, ifbm);
		break;
	}
	case CHASE: {
		if(chasesBaked.containsKey(name)){return;}
		chasesBaked.put(name, ifbm);
		break;
	}
	case EXTRA:{
		if(extrasBaked.containsKey(name)){return;}
		extrasBaked.put(name, ifbm);
		break;
	}
	case REINFORCE:{
		if(reinforcesBaked.containsKey(name)){return;}
		reinforcesBaked.put(name, ifbm);
		break;
	}
	default:
		break;
	}
}

public static IFlexibleBakedModel getBaked(CannonPart part, String name) {
	switch(part)
	{
	case CHAMBER:
		return chambersBaked.get(name);
	case CHASE:
		return chasesBaked.get(name);
	case EXTRA:
		return extrasBaked.get(name);
	case REINFORCE:
		return reinforcesBaked.get(name);
	default:
		return null;
	}
}

public static void setOffset(CannonPart part, String name, Vec3 vec)
{
	switch(part)
	{
	case CHAMBER:{
		if(chamberOffsets.containsKey(name)){return;}
		chamberOffsets.put(name, vec);
		return;
	}
	case CHASE:{
		if(chaseOffsets.containsKey(name)){return;}
		chaseOffsets.put(name, vec);
	}
	case EXTRA:{
		if(extraOffsets.containsKey(name)){return;}
		extraOffsets.put(name, vec);
	}
	default:{
		return;
	}
	}
}

public static void addReinforceOffsets(String name, Vec3[] vecs)
{
	if(vecs.length < 3)
	{
		System.out.println("Too few vector entries for " + name + "  3 are required.");
		System.out.println("Vector offsets required: Chase, Chamber, Extra");
		return;
	}
	if(reinforceOffsets.containsKey(name)){return;}
	if(vecs.length > 3)
	{
		System.out.println("Detected more than 3 vector entires.  Using the first 3 entries");
	}

	Vec3[] vecos = {vecs[0], vecs[1], vecs[2]};
	reinforceOffsets.put(name, vecos);
}

public static Vec3 getOffset(CannonPart part, String name) {

	switch(part)
	{
	case CHAMBER:{
		if(!chamberOffsets.containsKey(name)){return new Vec3(0,0,0);}
		return chamberOffsets.get(name);
	}
	case CHASE:{
		if(!chaseOffsets.containsKey(name)){return new Vec3(0,0,0);}
		return chaseOffsets.get(name);
	}
	case EXTRA:{
		if(extraOffsets.containsKey(name)){return new Vec3(0,0,0);}
		return extraOffsets.get(name);
	}
	default:
		return new Vec3(0,0,0);

	}
}

public static Vec3[] getReinforceOffset(String name)
{
	if(!reinforceOffsets.containsKey(name))
	{
		Vec3[] vecos = {new Vec3(0,0,0), new Vec3(0,0,0), new Vec3(0,0,0)};
		return vecos;
	}
	return reinforceOffsets.get(name);
}

public static void setScale(CannonPart part, String name, float scale)
{
	switch(part){
	case CHAMBER:{
		if(chamberScales.containsKey(name)){return;}
		chamberScales.put(name, scale);
		break;
	}
	case CHASE:{
		if(chaseScales.containsKey(name)){return;}
		chaseScales.put(name, scale);
		break;
	}
	case EXTRA:{
		if(extraScales.containsKey(name)){return;}
		extraScales.put(name, scale);
		break;
	}
	case REINFORCE:{
		if(reinforceScales.containsKey(name)){return;}
		reinforceScales.put(name, scale);
		break;
	}
	default:
		break;

	}
}

public static float getScale(CannonPart part, String name)
{
	switch(part)
	{
	case CHAMBER:{
		if(!chamberScales.containsKey(name)){return 1.0F;}
		return chamberScales.get(name);
	}
	case CHASE:{
		if(!chaseScales.containsKey(name)){return 1.0F;}
		return chaseScales.get(name);
	}
	case EXTRA: {
		if(!extraScales.containsKey(name)){return 1.0F;}
		return extraScales.get(name);
	}
	case REINFORCE:{
		if(!reinforceScales.containsKey(name)){return 1.0F;}
		return reinforceScales.get(name);
	}
	default:
		return 1.0F;
	}
}
}

 

 

 

Event Manager:

 

package com.scors.bioalchemy.event;

import com.scors.bioalchemy.render.ArmCannonSmartModel;
import com.scors.bioalchemy.render.ModelMapper;
import com.scors.bioalchemy.render.ModelMapper.CannonPart;

import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.model.IFlexibleBakedModel;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class AlchEventManager {

@SubscribeEvent
public void onModelBakeEvent(ModelBakeEvent event)
{
	System.out.println("Model Bake event triggered");
	Object object = event.modelRegistry.getObject(ArmCannonSmartModel.mrl);
	if(object instanceof IBakedModel)
	{
		IBakedModel existingModel = (IBakedModel)object;
		ArmCannonSmartModel customModel = new ArmCannonSmartModel(existingModel);
		event.modelRegistry.putObject(ArmCannonSmartModel.mrl, customModel);
	}

	for(String str:ModelMapper.getKeys(CannonPart.CHASE))
	{
		ModelResourceLocation mrl = ModelMapper.getUnbaked(CannonPart.CHASE, str);
		Object obj = event.modelRegistry.getObject(mrl);
		if(obj instanceof IFlexibleBakedModel)
		{
			ModelMapper.addBaked(CannonPart.CHASE, str, (IFlexibleBakedModel)obj);
		}
	}

	for(String str:ModelMapper.getKeys(CannonPart.REINFORCE))
	{
		ModelResourceLocation mrl = ModelMapper.getUnbaked(CannonPart.REINFORCE, str);
		Object obj = event.modelRegistry.getObject(mrl);
		if(obj instanceof IFlexibleBakedModel)
		{
			ModelMapper.addBaked(CannonPart.REINFORCE, str, (IFlexibleBakedModel)obj);
		}
	}

	for(String str:ModelMapper.getKeys(CannonPart.CHAMBER))
	{
		ModelResourceLocation mrl = ModelMapper.getUnbaked(CannonPart.REINFORCE, str);
		Object obj = event.modelRegistry.getObject(mrl);
		if(obj instanceof IFlexibleBakedModel)
		{
			ModelMapper.addBaked(CannonPart.CHAMBER, str, (IFlexibleBakedModel)obj);
		}
	}

	for(String str:ModelMapper.getKeys(CannonPart.EXTRA))
	{
		ModelResourceLocation mrl = ModelMapper.getUnbaked(CannonPart.REINFORCE, str);
		Object obj = event.modelRegistry.getObject(mrl);
		if(obj instanceof IFlexibleBakedModel)
		{
			ModelMapper.addBaked(CannonPart.EXTRA, str, (IFlexibleBakedModel)obj);
		}
	}
}

}

 

Link to comment
Share on other sites

All of those

// TODO Auto-generated method stub

might be the problem.

Those are generated by Eclipse when bringing in methods from an interface/super/etc.  They're considered comments by java's code.

 

I think he knows what a comment is... I guess his point is that you might want to implement them.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Link to comment
Share on other sites

All of those

// TODO Auto-generated method stub

might be the problem.

Those are generated by Eclipse when bringing in methods from an interface/super/etc.  They're considered comments by java's code.

 

I think he knows what a comment is... I guess his point is that you might want to implement them.

 

I don't doubt he knows what a comment is, but I elaborated because I have no idea if he uses Eclipse or not.  :)

Also, they are implemented from the MinecraftByExample ( MBE15 )

 

You should register model names.

Only item name itself automatically registered as model name.

 

Model Names and such are registered via AlchItems...

I also threw in an addVariantName just to see if it would help, but it didn't...

 

package com.scors.bioalchemy.items;

import com.scors.bioalchemy.BioAlchemy;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class AlchItems {

public static ItemArmCannon itemArmCannon;
public static ItemCannonChase itemChase;
public static ItemCannonChamber itemChamber;
public static ItemCannonReinforce itemReinforce;
public static ItemCannonExtra itemExtra;

public static void initItems()
{
	System.out.println("Initing items");
	itemArmCannon = (ItemArmCannon)(new ItemArmCannon().setUnlocalizedName("armcannon"));
	itemChase = (ItemCannonChase)(new ItemCannonChase().setUnlocalizedName("itemchase"));
	itemChamber = (ItemCannonChamber)(new ItemCannonChamber().setUnlocalizedName("itemchamber"));
	itemReinforce = (ItemCannonReinforce)(new ItemCannonReinforce().setUnlocalizedName("itemreinforce"));
	itemExtra = (ItemCannonExtra)(new ItemCannonExtra().setUnlocalizedName("itemextra"));

	GameRegistry.registerItem(itemArmCannon, "armcannon");
	GameRegistry.registerItem(itemChase, "itemchase");
	GameRegistry.registerItem(itemChamber, "itemchamber");
	GameRegistry.registerItem(itemReinforce, "itemreinforce");
	GameRegistry.registerItem(itemExtra, "itemextra");
}

@SideOnly(Side.CLIENT)
public static void preInitItemRenders()
{
	ModelBakery.addVariantName(itemChase, BioAlchemy.modid+":chases/defaultchase");
	ModelBakery.addVariantName(itemChamber, BioAlchemy.modid+":chambers/defaultchamber");

	ModelBakery.addVariantName(itemArmCannon, BioAlchemy.modid+":armcannon", 
			BioAlchemy.modid +":chases/defaultchase");
}

@SideOnly(Side.CLIENT)
public static void initItemRenders()
{
	System.out.println("Initing Item Renders");
	registerRenderInv(itemArmCannon, "armcannon");
	registerRenderInv(itemChase, "chases/defaultchase");
}

public static void registerRenderInv(Item item, String name)
{
	registerRender(item, 0, name, "inventory");
}

public static void registerRender(Item item, int meta, String name, String location)
{
	ModelResourceLocation mrl = new ModelResourceLocation(BioAlchemy.modid+":"+name, location);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, mrl);
}

}

The initItems() is called in the common proxy's preInit() field.

 

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It is the field that accesses the portal entrance position relative to the entity. So very much needed to make a portal work. What I don't understand is why the access widener works when running the client in Intellij but doesn't after I publish the jar and try to play with game with it.
    • So I'm using a mod that adds a "god sword" into the game. This sword is unfortunately not enchantable so I'm looking to change it. The only code that seems related is in the weapon's .class file which is here:  public int getItemEnchantability() { return this.tier.m_6601_(); }   The entire file is below: package blackwolf00.elementalswords.common; import blackwolf00.elementalswords.config.ConfigEffects; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import com.mojang.blaze3d.platform.InputConstants; import java.util.List; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Tier; import net.minecraft.world.item.TieredItem; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.Vanishable; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ToolAction; import net.minecraftforge.common.ToolActions; public class FusionSword extends TieredItem implements Vanishable { private final float totalDamage; private final Tier tier; private final Multimap<Attribute, AttributeModifier> defaultModifiers; public FusionSword(Tier tierIn, int damage, float speed, Item.Properties builderIn) { super(tierIn, builderIn); this.tier = tierIn; this.totalDamage = damage + this.tier.m_6631_(); ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); builder.put(Attributes.f_22281_, new AttributeModifier(f_41374_, "Weapon modifier", this.totalDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.f_22283_, new AttributeModifier(f_41375_, "Weapon modifier", speed, AttributeModifier.Operation.ADDITION)); this.defaultModifiers = (Multimap<Attribute, AttributeModifier>)builder.build(); } public int getItemEnchantability() { return this.tier.m_6601_(); } public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { return (this.tier.m_6282_().test(repair) || isRepairable(toRepair)); } public float getAttackDamage() { return this.totalDamage; } public boolean m_6777_(BlockState state, Level level, BlockPos pos, Player player) { return !player.m_7500_(); } public float m_8102_(ItemStack stack, BlockState state) { return 1.0F; } public boolean m_7579_(ItemStack stack, LivingEntity target, LivingEntity attacker) { stack.m_41622_(1, attacker, entity -> entity.m_21166_(EquipmentSlot.MAINHAND)); return true; } public boolean m_6813_(ItemStack stack, Level level, BlockState state, BlockPos pos, LivingEntity entityLiving) { if (state.m_60800_((BlockGetter)level, pos) != 0.0F) stack.m_41622_(2, entityLiving, entity -> entity.m_21166_(EquipmentSlot.MAINHAND)); return true; } public boolean m_8096_(BlockState blockIn) { return blockIn.m_60713_(Blocks.f_50033_); } public boolean m_5812_(ItemStack item) { return true; } public Multimap<Attribute, AttributeModifier> m_7167_(EquipmentSlot equipmentSlot) { return (equipmentSlot == EquipmentSlot.MAINHAND) ? this.defaultModifiers : super.m_7167_(equipmentSlot); } public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) { return super.onLeftClickEntity(stack, player, entity); } @OnlyIn(Dist.CLIENT) public void m_7373_(ItemStack stack, Level level, List<Component> tooltip, TooltipFlag flag) { super.m_7373_(stack, level, tooltip, flag); if (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340)) { tooltip.add(Component.m_237115_("tooltip.fusion_sword").m_130940_(ChatFormatting.GRAY)); } else { tooltip.add(Component.m_237115_("tooltip.hold_shift").m_130940_(ChatFormatting.GRAY)); } } public InteractionResultHolder<ItemStack> m_7203_(Level level, Player playerIn, InteractionHand handIn) { if (((Boolean)ConfigEffects.JUMP_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19603_, 10000, ((Integer)ConfigEffects.JUMP_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.MOVEMENT_SPEED_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19596_, 10000, ((Integer)ConfigEffects.MOVEMENT_SPEED_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.SLOW_FALLING_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19591_, 10000, ((Integer)ConfigEffects.SLOW_FALLING_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.ABSORPTION_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19617_, 10000, ((Integer)ConfigEffects.ABSORPTION_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DAMAGE_RESISTANCE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19606_, 10000, ((Integer)ConfigEffects.DAMAGE_RESISTANCE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DAMAGE_BOOST_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19600_, 10000, ((Integer)ConfigEffects.DAMAGE_BOOST_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.CONDUIT_POWER_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19592_, 10000, ((Integer)ConfigEffects.CONDUIT_POWER_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.DOLPHINS_GRACE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19593_, 10000, ((Integer)ConfigEffects.DOLPHINS_GRACE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.WATER_BREATHING_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19608_, 10000, ((Integer)ConfigEffects.WATER_BREATHING_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.FIRE_RESISTANCE_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19607_, 10000, ((Integer)ConfigEffects.FIRE_RESISTANCE_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.HEALTH_BOOST_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19616_, 10000, ((Integer)ConfigEffects.HEALTH_BOOST_F_LEVEL.get()).intValue() - 1)); if (((Boolean)ConfigEffects.REGENERATION_F.get()).booleanValue()) playerIn.m_7292_(new MobEffectInstance(MobEffects.f_19605_, 10000, ((Integer)ConfigEffects.REGENERATION_F_LEVEL.get()).intValue() - 1)); return InteractionResultHolder.m_19098_(playerIn.m_21120_(handIn)); } public boolean canPerformAction(ItemStack stack, ToolAction toolAction) { return ToolActions.DEFAULT_SWORD_ACTIONS.contains(toolAction); } } How do I make this thing enchantable?  
    • The mod I'm working on is in 1.19.2. The portal works correctly in Intellij but when I publish the jar, put it in the mods folder of the game it crashes with the following error whenever any entity collides with it: java.lang.IllegalAccessError: class com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock tried to access protected field net.minecraft.world.entity.Entity.f_19819_ (com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock is in module [email protected] of loader 'TRANSFORMER' @16c5b50a; net.minecraft.world.entity.Entity is in module [email protected] of loader 'TRANSFORMER' @16c5b50a)     at com.github.warrentode.turtleblockacademy.blocks.TBAMiningPortalBlock.m_7892_(TBAMiningPortalBlock.java:124) ~[turtleblockacademy-2024.2025-1.0.0.jar%23572!/:2024.2025-1.0.0] {re:classloading} The thing is, I have Entity.f_19819_ in my accessTransformer.cfg file in this line: public net.minecraft.world.entity.Entity f_19819_ # portalEntrancePos So what do I need to do to fix this error?
    • It will be about medeaival times
  • Topics

×
×
  • Create New...

Important Information

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