
BentiGorlich
Members-
Posts
34 -
Joined
-
Last visited
Everything posted by BentiGorlich
-
Minecraft 1.17.1 - forge-37.1.0 crashes immediately
BentiGorlich replied to BentiGorlich's topic in Support & Bug Reports
Anyone have thoughts on this? -
Minecraft 1.17.1 - forge-37.1.0 crashes immediately
BentiGorlich replied to BentiGorlich's topic in Support & Bug Reports
It is empty -
Minecraft 1.17.1 - forge-37.1.0 crashes immediately
BentiGorlich replied to BentiGorlich's topic in Support & Bug Reports
I think I found it: [21:16:52] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' [21:16:53] [Render thread/INFO]: Setting user: ---- [21:16:53] [Render thread/INFO]: Backend library: LWJGL version 3.2.2 build 10 [21:16:54] [Render thread/INFO]: Narrator library for x64 successfully loaded [21:16:55] [Render thread/INFO]: Reloading ResourceManager: Default [21:16:59] [Render thread/INFO]: OpenAL initialized. [21:16:59] [Render thread/INFO]: Sound engine started [21:16:59] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/blocks.png-atlas [21:16:59] [Render thread/INFO]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas [21:16:59] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/banner_patterns.png-atlas [21:16:59] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/shield_patterns.png-atlas [21:16:59] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas [21:16:59] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas [21:16:59] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas [21:17:01] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas [21:17:01] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas [21:17:01] [Render thread/INFO]: Created: 256x128x0 minecraft:textures/atlas/mob_effects.png-atlas [21:17:06] [Render thread/INFO]: Stopping! And there was a debug.log: And there is a launcher_log.txt: -
Minecraft 1.17.1 - forge-37.1.0 crashes immediately
BentiGorlich replied to BentiGorlich's topic in Support & Bug Reports
where do I find that? -
Hi everyone, I use the Curse Forge app for overwatch and I created a plain 1.17.1 forge 37.1.0 profile. It crashes immediately when I click "play" in the minecraft launcher. I just installed Java 16 and set minecraft to use it in the curse forge app settings. I don't have any mods installed and my log looks like this: [12:36:42] [main/INFO]: ModLauncher running: args [--username, MrKatuffel, --version, forge-37.1.0, --gameDir, C:\Users\Benni\Documents\Minecraft\Instances\1.17.1, --assetsDir, C:\Users\Benni\Documents\Minecraft\Install\assets, --assetIndex, 1.17, --uuid, 2021e6cbc7bc4d2a81effa163cfd62d9, --accessToken, ????????, --userType, mojang, --versionType, release, --width, 1024, --height, 768, --launchTarget, forgeclient, --fml.forgeVersion, 37.1.0, --fml.mcVersion, 1.17.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210706.113038] [12:36:42] [main/INFO]: ModLauncher 9.0.7+91+master.8569cdf starting: java version 16.0.1 by Microsoft [12:36:42] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=union:/C:/Users/Benni/Documents/Minecraft/Install/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar%2318! Service=ModLauncher Env=CLIENT [12:36:43] [main/INFO]: Found mod file fmlcore-1.17.1-37.1.0.jar of type LIBRARY with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@6cc0bcf6 [12:36:43] [main/INFO]: Found mod file javafmllanguage-1.17.1-37.1.0.jar of type LANGPROVIDER with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@6cc0bcf6 [12:36:43] [main/INFO]: Found mod file mclanguage-1.17.1-37.1.0.jar of type LANGPROVIDER with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@6cc0bcf6 [12:36:43] [main/INFO]: Found mod file client-1.17.1-20210706.113038-srg.jar of type MOD with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@6cc0bcf6 [12:36:43] [main/INFO]: Found mod file forge-1.17.1-37.1.0-universal.jar of type MOD with locator net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@6cc0bcf6 So I can see it is indeed using Java 16. The error message of the minecraft launcher is just: So that isn't helping. Anyone have any ideas?
-
Any further advice would be appreciated
-
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
I have the problem, that nothing is happening. I have the loader and the model in the blockstate.json: (if I remove the model property it just renders as the default black/pink block) { "variants": { "": { "loader": "gates:gate_placer_loader", "model": "gates:block/gate_placer" } } } But my GatePlacerModel class is never called. ModelLoader: public class GatePlacerModelLoader implements IModelLoader<GatePlacerModelConfiguration> { public static GatePlacerModelLoader INSTANCE = new GatePlacerModelLoader(); @Override public void onResourceManagerReload(IResourceManager resourceManager) { // TODO Auto-generated method stub } @Override public GatePlacerModelConfiguration read(JsonDeserializationContext deserializationContext, JsonObject modelContents) { return new GatePlacerModelConfiguration(); } } ModelConfiguration: public class GatePlacerModelConfiguration implements IModelGeometry<GatePlacerModelConfiguration> { @Override public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) { return new GatePlacerModel(overrides); } @Override public Collection getTextures(IModelConfiguration owner, Function modelGetter, Set missingTextureErrors) { Set<RenderMaterial> texs = Sets.newHashSet(); if (owner.isTexturePresent("base")) texs.add(owner.resolveTexture("base")); if (owner.isTexturePresent("all")) texs.add(owner.resolveTexture("all")); return texs; } } Model: public class GatePlacerModel extends BakedModel { public GatePlacerModel(ItemOverrideList overrides) { super(false, false, false, null, overrides, null, null); // TODO Auto-generated constructor stub } @Override public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand, IModelData extraData) { if(extraData.hasProperty(GatePlacerTileEntity.MIMICED_BLOCKSTATE_PROPERTY)) { BlockState mimiced = extraData.getData(GatePlacerTileEntity.MIMICED_BLOCKSTATE_PROPERTY); IBakedModel mimicedModel = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState(mimiced); return mimicedModel.getQuads(mimiced, side, rand, extraData); } else { return super.getQuads(state, side, rand, extraData); } } } Inside of my block i have this method: @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ItemStack activeStack = player.getHeldItem(handIn); if(activeStack.getItem() instanceof BlockItem) { Block block = ((BlockItem)activeStack.getItem()).getBlock(); ((GatePlacerTileEntity)worldIn.getTileEntity(pos)).setMimicedBlockState(block.getDefaultState()); // notify for block update, so the new mimiced block is synced in the tileentity class worldIn.notifyBlockUpdate(pos, state, state.with(MIMICED, Boolean.valueOf(true)), 2); return ActionResultType.SUCCESS; } return ActionResultType.FAIL; } Am I doing something wrong? -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Ok so I have run into a problem again. How do I get the model of the mimiced block from its blockstate? To clarify: where do I register my created model so that my block is rendered by it? -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Ok, so that was the part I missed before. Thank you, I will try that -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Done In your model you need to delegate the methods (the most important one is probably just getQuads) to the other model. Which "other model" you use depends on the model data (it has the mimiced block state in it). By delegating to the other model here, your block will appear as if it had that other model. Which class do you mean with "model"? I do not have a method called `getQuads()` in the GatePlacerModelLoader class, the GatePlacerModelConfiguration class, the GatePlacerBlock class, or the GatePlacerTileEntity class. So do I have to make another class class GatePlacerModel? and where would I register it, so it renders my block? Its given to you as the IModelData in your IBakedModel. This is the same model data you returned from your tile entity. In the GatePlacerModelConfiguration class I have to return a `IBakedModel` in the bake method. How do I build it? And where would I have a method for using the baked model? -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
So I started looking into it. Sadly forge only has examples with the bucket item that are helpful, so I could not get the gist of it. I have these 2 classes now: public class GatePlacerModelLoader implements IModelLoader<GatePlacerModelConfiguration> { public static GatePlacerModelLoader INSTANCE = new GatePlacerModelLoader(); @Override public void onResourceManagerReload(IResourceManager resourceManager) { // TODO Auto-generated method stub } @Override public GatePlacerModelConfiguration read(JsonDeserializationContext deserializationContext, JsonObject modelContents) { // TODO Auto-generated method stub return null; } } public class GatePlacerModelConfiguration implements IModelGeometry<GatePlacerModelConfiguration> { @Override public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) { return null; } @Override public Collection getTextures(IModelConfiguration owner, Function modelGetter, Set missingTextureErrors) { // TODO Auto-generated method stub return null; } } And I register the loader like so: public void init(FMLServerStartingEvent event) { ModelLoaderRegistry.registerLoader(new ResourceLocation(MODID, "gate_placer"), GatePlacerModelLoader.INSTANCE); } My problem is, that I couldn't find a reference to how these are called for rendering - how to tell them which block they should render through my render model - how do I get the blockstate of the mimiced block (I can't get the normal block state eigher...) -
Ok thanks, I tried to do it, but I ran into an issue. I want to overlay a texture when eigher sidetype is input or output: getVariantBuilder(BlockInit.gate_or).forAllStates(state -> { Builder<?> configuredModel = ConfiguredModel.builder(); if(state.get(RedstoneGate.POWERED)) configuredModel.modelFile(models().singleTexture("gate_or", mcLoc("block/gate_or"), "gate_or", mcLoc("block/gate_or"))); else configuredModel.modelFile(models().singleTexture("gate_or", mcLoc("block/gate_or"), "gate_or", mcLoc("block/gate_or"))); if(state.get(RedstoneGate.EAST_SIDETYPE) == SideType.Input) { } else if(state.get(RedstoneGate.EAST_SIDETYPE) == SideType.Output) { } if(state.get(RedstoneGate.SOUTH_SIDETYPE) == SideType.Input) { } else if(state.get(RedstoneGate.SOUTH_SIDETYPE) == SideType.Output) { } if(state.get(RedstoneGate.WEST_SIDETYPE) == SideType.Input) { } else if(state.get(RedstoneGate.WEST_SIDETYPE) == SideType.Output) { } if(state.get(RedstoneGate.NORTH_SIDETYPE) == SideType.Input) { } else if(state.get(RedstoneGate.NORTH_SIDETYPE) == SideType.Output) { } return configuredModel.build(); }); I don't really understand what I have to call for that. I do have the idea, that it would be possibile to do it just in a json, becuase Ender IO does it in 1.12.2 in their BlockMachineBase.json: https://github.com/SleepyTrousers/EnderIO/blob/master/enderio-base/src/main/resources/assets/enderio/blockstates/block_machine_base.json But I don't know how to work with these submodels and overlays. My take on this looks like this: { "forge_marker": 1, "defaults": { "model": "gates:block/gate_or" }, "variants": { "facing": { "north": {}, "south": {"y": 180}, "west": {"y": 270}, "east": {"y": 90} }, "powered": { "true": { "model": "gates:block/gate_or" }, "false": { "model": "gates:block/gate_or" } }, "north_sidetype": { "i": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "model":"gates:block/gate_or" } }, "o": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "model":"gates:block/gate_or" } }, "n": {} }, "east_sidetype": { "i": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 90 } }, "o": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 90 } }, "n": {} }, "south_sidetype": { "i": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 180 } }, "o": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 180 } }, "n": {} }, "west_sidetype": { "i": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 270 } }, "o": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "model":"gates:block/gate_or", "y": 270 } }, "n": {} } } } But it doesn't work. The log file just says "missing model for variant:" for every variant there is and at the end: "in resourcepack: 'Mod Resources': Missing model, expected to find a string" And I don't know how would deal with submodels in the BlockStateProvider class
-
Hello Modders, I have a block with 5 state properties: public static final SideTypeProperty NORTH_SIDETYPE = SideTypeProperty.create("north_sidetype", SideType.None, SideType.Input, SideType.Output); public static final SideTypeProperty EAST_SIDETYPE = SideTypeProperty.create("east_sidetype", SideType.None, SideType.Input, SideType.Output); public static final SideTypeProperty SOUTH_SIDETYPE = SideTypeProperty.create("south_sidetype", SideType.None, SideType.Input, SideType.Output); public static final SideTypeProperty WEST_SIDETYPE = SideTypeProperty.create("west_sidetype", SideType.None, SideType.Input, SideType.Output); protected RedstoneGate() { super(Properties.create(Material.MISCELLANEOUS).zeroHardnessAndResistance().sound(SoundType.WOOD)); this.setDefaultState(this.stateContainer.getBaseState() .with(HORIZONTAL_FACING, Direction.NORTH) .with(POWERED, Boolean.valueOf(false)) .with(NORTH_SIDETYPE, SideType.None) .with(EAST_SIDETYPE, SideType.Input) .with(SOUTH_SIDETYPE, SideType.Output) .with(WEST_SIDETYPE, SideType.Input)); } At first I made the mistake to note every combination down. This of course was an insane task and I would have to do it for 5 other blocks as well. So the question is how to write an advanced json file that is not insanely long. I tried it with the multipart style, but the debug log says, that it didn't work. Here it is: { "multipart": [ { "apply": { "model": "gates:block/gate_or" }}, { "when": {"facing":"east"}, "apply": { "y": 90 } }, { "when": {"facing":"south"}, "apply": { "y": 180 } }, { "when": {"facing":"west"}, "apply": { "y": 270 } }, { "when": {"facing":"west"}, "apply": { "y": 270 } }, { "when": {"north_sidetype":"i"}, "apply": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"north_sidetype":"o"}, "apply": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"east_sidetype":"i"}, "apply": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"east_sidetype":"o"}, "apply": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"south_sidetype":"i"}, "apply": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"south_sidetype":"o"}, "apply": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"west_sidetype":"i"}, "apply": { "textures": { "overlay":"gates:blocks/iOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } }, { "when": {"west_sidetype":"o"}, "apply": { "textures": { "overlay":"gates:blocks/oOverlay" }, "submodel": { "overlay": { "model":"gates:overlay" } } } } ] } Any idea how to do it? Thanks in advance
-
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Yeah you were right, I could have found that by mysqlf, sorry. Done I don't know how to do that. The only time i really synced something to a client was through a open gui call, how would i send something to sync that up in the `onBlockActivated` method? Can you give me a class to refer to? I really don't know which class I would have to extend for that, nor where to register it I really appreciate your help -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
It would be ok if there was the limitation that it could only look like other cubes and not like a torch for example. Thats why I thought, that shouldn't be that hard, just replace the texture from it with the texture from the right clicked block. how do I get an IModelData object from a BlockState? BlockRendererDispatcher#getModelForState is not static, how would I get an instance of that? -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Ok tanks, that is very helpful. I will try that later on. But I do have one question already: where do I get the texture I have to render from, or is it contained in the BlockState and I dont really have to worry about that? -
[1.16.4] Change Texture onBlockActivated
BentiGorlich replied to BentiGorlich's topic in Modder Support
Ok i was not clear enough. I want it to be able to use any texture of any block on this. So if i right click it with oak planks it becomes an oak plank block (texture wise), if i right click it with stone it becomes stone and so on. -
Hallo Modders, I want to have my Block change the texture to the texture of the block it is right clicked with. I honestly have no idea how this would be done other than override the `onBlockActivated` method. Any idea how this could be done? It would be helpful if you could name a mod on 1.16 that does this in some regard, too. Thanks in advance
-
Yeah that did the trick, thank you ๐
-
Ok, so as always for the fast reply. This is just the copied code from actually additions from 1.12. As far as I have observed, it didn't do anything. I checked if the code is called at all and it is called when it is supposed to be called. My main problem is, that i don't know where the used position is specified. In the "Everything else" section the block position is never used, so I don't know why the code should work in the first place. It could be, that it places a block somewhere in the world, but I don't know
-
Hello dear Modders, I want a tile entity to place a block. Sadly there isn't a function inside the ServerWorld class for that (there is for destroying a block though) I looked at the actually additions mod and its code for the block placer, which looks like this: public static ItemStack useItemAtSide(Direction side, World world, BlockPos pos, ItemStack stack) { if (world instanceof ServerWorld && pos != null) { BlockPos offsetPos = pos.offset(side); BlockState state = world.getBlockState(offsetPos); boolean replaceable = state.getMaterial().isReplaceable(); //Redstone if (replaceable && stack.getItem() == Items.REDSTONE) { world.setBlockState(offsetPos, Blocks.REDSTONE_WIRE.getDefaultState(), 2); stack.shrink(1); return stack; } //Plants if (replaceable && stack.getItem() instanceof IPlantable) { if (((IPlantable) stack.getItem()).getPlant(world, offsetPos).isValidPosition(world, offsetPos)) { if (world.setBlockState(offsetPos, ((IPlantable) stack.getItem()).getPlant(world, offsetPos), 2)) { stack.shrink(1); return stack; } } } //Everything else try { FakePlayer fake = FakePlayerFactory.getMinecraft((ServerWorld) world); if (fake.connection == null) fake.connection = new EmptyNetHandler(fake); ItemStack heldBefore = fake.getHeldItemMainhand(); setHandItemWithoutAnnoyingSound(fake, Hand.MAIN_HAND, stack.copy()); fake.interactionManager.processRightClick(fake, world, fake.getHeldItemMainhand(), Hand.MAIN_HAND); ItemStack result = fake.getHeldItem(Hand.MAIN_HAND); setHandItemWithoutAnnoyingSound(fake, Hand.MAIN_HAND, heldBefore); return result; } catch (Exception e) { GatesMod.logger.error("Something that places Blocks at " + offsetPos.getX() + ", " + offsetPos.getY() + ", " + offsetPos.getZ() + " in World " + world.getDimensionKey() + " threw an Exception! Don't let that happen again!", e); } } return stack; } it didnt work for me, so maybe I am doing something wrong here... It is for 1.12 though, so it could be possibile that it just wont work for 1.16. Any idea how this could be done? Tanks in advance ๐
-
Ok so I found the method @diesieben07 meant and it works now, thanks for the help, again. Just for anyone stumbling over this: In the onBlockActivated method of the block that has the gui, do something like this: NetworkHooks.openGui((ServerPlayerEntity)player, controllerTileEntity, (buffer) -> { buffer.writeBlockPos(pos); // write to it whatever you want } ); And then on the Container for that TileEntity: public GateControllerContainer(final int windowID, final PlayerInventory playerInventory, final PacketBuffer data) { // in the data variable lies the information you sent when calling openGui } As far as I know you have to have this constructor anyways, because you cannot register the container otherwise (but I am not sure about this)
-
Ok, i'll try it. Thanks for the lightning fast help ๐
-
This is what i am doing to open the gui: @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); ItemStack heldItemStack = player.getHeldItemMainhand(); if(heldItemStack.getItem() instanceof BlockItem) { BlockItem heldBlockItem = (BlockItem)heldItemStack.getItem(); if(heldBlockItem.getBlock() instanceof GatePlacer) { GatePlacer heldPlacer = (GatePlacer)((BlockItem)heldItemStack.getItem()).getBlock(); heldPlacer.setController(this); player.sendStatusMessage(new StringTextComponent("Set new controller"), false); } } else if(tileEntity instanceof GateControllerTileEntity) { NetworkHooks.openGui((ServerPlayerEntity)player, (GateControllerTileEntity)tileEntity, pos); return ActionResultType.SUCCESS; } } return ActionResultType.FAIL; } is that correct?
-
On loadup i can see that 4 of my tileentities have loaded their data: the first number is the ID of the tileEntity. when i access the guis of these i always have a higher ID than that and the tileEntities don't have data on them