Everything posted by Issac29
-
[1.15.2] Datapack ordering Issues
Opps that was a mistake
-
[1.15.2] Datapack ordering Issues
I tried to load up my recipe datapack for flint and steel which by default vanilla datapack contains an iron ingot instead of steel nugget. Nothing happened and still got the same recipe. I used the command "/datapack list enabled" and I got this. My mod datapack has a lower priority than the forge datapack therefore the recipe uses the forge datapack. THIS FORUM TOPIC MAY BE MOVED TO A DIFFERENT SECTION.
-
[1.15.2] Overriding vanilla ore block drops are dropping nothing
You forgot the very first '{' in your code.
-
[1.15.2] Fluid Tanks
I see no other container classes overriding detectAndSendChanges. Also why a custom packet.
-
[1.15.2] Fluid Tanks
I guess that can cause server lag. How am I able to do that. Also I could not find anything that relates to that.
-
[1.15.2] Fluid Tanks
What the Images don't give enough information. Fine here is the code. public class TankTileEntity extends TileEntity implements INamedContainerProvider, ITickableTileEntity { ManualTank tank = new ManualTank(8000, this); private LazyOptional<FluidTank> optional = LazyOptional.of(() -> this.tank); public TankTileEntity() { super(INCTileEntityTypes.TANK); } @Override public void read(CompoundNBT compound) { super.read(compound); CompoundNBT nbtfluid = compound.getCompound("tank"); //$NON-NLS-1$ this.tank.readFromNBT(nbtfluid); } @Override public CompoundNBT write(CompoundNBT compound) { compound.put("tank", this.tank.writeToNBT(new CompoundNBT())); //$NON-NLS-1$ return super.write(compound); } @Override public CompoundNBT getUpdateTag() { CompoundNBT nbt = super.getUpdateTag(); return this.write(nbt); } @Override public boolean receiveClientEvent(int id, int type) { return true; } @Override public void handleUpdateTag(CompoundNBT tag) { read(tag); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap) { return cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY ? this.optional.cast() : super.getCapability(cap); } @Override public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) { return new TankContainer(p_createMenu_1_, this.world, this.pos, p_createMenu_2_); } @Override public ITextComponent getDisplayName() { return new TranslationTextComponent("container.tank"); //$NON-NLS-1$ } public FluidTank getTank() { return this.tank; } @Override public void tick() { return; } }
-
[1.15.2] Fluid Tanks
Alright most of the tank is synced but the only problem is the when I type this command /setblock x y z namespace:tankName{tankData: {FluidName: #fluidName, Amount: #amount}}, the server loads the data but the client does not load until reloading the world or chunk. That same applies to /data modify block x y z tankData set value {FluidName: #fluidName, Amount: #Amount}. I used every method to sync the client but some odd reason they don't sync when changing the tank value with commands. Before Reloading Chunks: After Reloading Chunks:
-
[1.15.2] Fluid Tanks
I figured out that to get the sprite texture, you needed the Fluid#getAttributes#getStillTexture to obtain that texture. No need for getting the model or the blockstate for just a simple four step code. AtlasTexture texture = minecraft.getModelManager().getAtlasTexture(PlayerContainer.LOCATION_BLOCKS_TEXTURE); TextureAtlasSprite sprite = texture.getSprite(Fluids.WATER.getAttributes().getStillTexture()); texture.bindTexture(); blit(70, 20, 0, 32, 32, sprite);
-
[1.15.2] Fluid Tanks
The texture for weird reason returns "minecraft:missingno". This does not make any sense. As for the model it seems to have a number SimpleBakedModel@411933.
-
[1.15.2] Fluid Tanks
OK I renamed the method "addScreen" to "drawFluidTexture". Which makes more sense. @SuppressWarnings("resource") private void drawFluidTexture(int x, int y) { TextureAtlasSprite texture = this.minecraft.getModelManager().getModel(new ResourceLocation("minecraft:water")).getParticleTexture(EmptyModelData.INSTANCE); texture.getAtlasTexture().bindTexture(); blit(84, 12, 0, 32, 32, texture); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.font.drawString(this.title.getFormattedText(), 8.0F, 7.0F, 4210752); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 5), 4210752); drawFluidTexture(mouseX, mouseY); } But still has a missing texture. Maybe I needed to soft code it into something better.
-
[1.15.2] Fluid Tanks
Anyway Here is the better code. @SuppressWarnings("resource") private void addScreen(int x, int y) { TextureAtlasSprite sprite = getSprite(new ResourceLocation("minecraft:water")); sprite.getAtlasTexture().bindTexture(); blit(100, 50, 0, 32, 32, sprite); } public TextureAtlasSprite getSprite(ResourceLocation resourceLocation) { return this.minecraft.getAtlasSpriteGetter(PlayerContainer.LOCATION_BLOCKS_TEXTURE).apply(resourceLocation); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.font.drawString(this.title.getFormattedText(), 8.0F, 7.0F, 4210752); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 5), 4210752); addScreen(mouseX, mouseY); } Edit: For odd reason there still a invalid or missing texture.
-
[1.15.2] Fluid Tanks
I know it makes nonsense but I am trying to get the fluid texture into the tank screen. I used water as an example.
-
[1.15.2] Fluid Tanks
I used water as an example. The parameters were 16, 16, one, 16, 16, and water. Did I forget something? private void addScreen() { @SuppressWarnings("resource") TextureAtlasSprite sprite = getSprite(new ResourceLocation("minecraft", "water")); // This is the one I used blit(16, 16, 1, 16, 16, sprite); } public TextureAtlasSprite getSprite(ResourceLocation resourceLocation) { return this.minecraft.getAtlasSpriteGetter(PlayerContainer.LOCATION_BLOCKS_TEXTURE).apply(resourceLocation); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.font.drawString(this.title.getFormattedText(), 8.0F, 7.0F, 4210752); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 5), 4210752); addScreen(); }
-
[1.15.2] Fluid Tanks
I tried using the method blit(int a, int b, int c, int d, int e, TextureAltasSprite f)but that did not work.
-
[1.15.2] Fluid Tanks
Yeah, but that texture needs to bind into the GUI which is the problem. I tried to use Minecraft#getAltasSprtiteGettter but I get a mess of textures.
-
[1.15.2] Fluid Tanks
How am I going to have that specific texture.
-
[1.15.2] Fluid Tanks
Alright, I am currently working on the fluid tanks that display how much fluid is the tile. The problem is I don't know how to display the fluid and render. Here are some Codes Tile Entity Code: Screen Code: Container Code:
-
[Latest] Outdated Documentation
Alright Thanks.
-
[Latest] Outdated Documentation
As of 1.14.x and 1.15.x versions, some of the documentation seems to have been outdated. I found some of them: https://mcforge.readthedocs.io/en/latest/blocks/blocks/ https://mcforge.readthedocs.io/en/latest/utilities/recipes/ https://mcforge.readthedocs.io/en/latest/blocks/states/ https://mcforge.readthedocs.io/en/latest/items/items/ If there is any that I missed, because some of them may be misleading to some modders.
-
[1.12.2] Entity hands not rendering via an inventory
So IMessage is the replacement or a substitution for IPacket.
-
[1.12.2] Entity hands not rendering via an inventory
The interface IPacket. If a class implementing an IPacket then where does the it gets used for client networking?
-
[1.12.2] Entity hands not rendering via an inventory
Although those unnecessary tries and catches, we might be getting too off topic with this title. Where do the custom packets used at.
-
[1.12.2] Entity hands not rendering via an inventory
Well for the useless number 4 exceptions. also known as the unnecessary exceptions which doesn't throw a compile error, unlike IO exceptions which do throw a compile unless there is a try and catch or a "throws" statement. Well not true. Well this is getting well off topic.
-
[1.12.2] Entity hands not rendering via an inventory
So try and catch isn't reliable.
-
[1.12.2] Entity hands not rendering via an inventory
Are there seriously neither of them in categories 1, 2, nor 3.
IPS spam blocked by CleanTalk.