Skip to content

Commit 4d5cdf3

Browse files
committed
Some fixes
1 parent 9b40220 commit 4d5cdf3

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

src/main/resources/forge-1.19.2/procedures/block_fluidtank_fill.java.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<#-- @formatter:off -->
44
{
55
BlockEntity _ent = world.getBlockEntity(${toBlockPos(input$x,input$y,input$z)});
6+
int _amount = ${opt.toInt(input$amount)};
67
if (_ent != null)
78
_ent.getCapability(ForgeCapabilities.FLUID_HANDLER, ${input$direction}).ifPresent(capability ->
8-
capability.fill(new FluidStack(${generator.map(field$fluid, "fluids")}, ${opt.toInt(input$amount)}), IFluidHandler.FluidAction.EXECUTE)
9+
capability.fill(new FluidStack(${generator.map(field$fluid, "fluids")}, _amount), IFluidHandler.FluidAction.EXECUTE)
910
);
1011
}
1112
<#-- @formatter:on -->
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
(${input$entity} instanceof LivingEntity _teamEnt && _teamEnt.level().getScoreboard()
1+
(${input$entity} instanceof LivingEntity _teamEnt && _teamEnt.level.getScoreboard()
22
.getPlayersTeam(_teamEnt instanceof Player _pl ? _pl.getGameProfile().getName() : _teamEnt.getStringUUID()) != null ?
3-
_teamEnt.level().getScoreboard().getPlayersTeam(_teamEnt instanceof Player _pl ? _pl.getGameProfile().getName() : _teamEnt.getStringUUID()).getName() : "")
3+
_teamEnt.level.getScoreboard().getPlayersTeam(_teamEnt instanceof Player _pl ? _pl.getGameProfile().getName() : _teamEnt.getStringUUID()).getName() : "")

src/main/resources/forge-1.19.2/procedures/utils/entity/entity_has_item_inventory.java.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ private static boolean hasEntityInInventory(Entity entity, ItemStack itemstack)
44
List<NonNullList<ItemStack>> compartments = com.google.common.collect.ImmutableList.of(inventory.items, inventory.armor, inventory.offhand);
55
for (List<ItemStack> list : compartments) {
66
for (ItemStack itemstack2 : list) {
7-
if (itemstack.isSame(itemstack2)) {
7+
if (itemstack.sameItem(itemstack2)) {
88
return true;
99
}
1010
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<#include "mcelements.ftl">
22
if (world instanceof ServerLevel _level)
33
_level.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY)
4-
.getHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, new ResourceLocation("${generator.map(field$feature, "configuredfeatures")}"))
5-
.value().place(_level, _level.getChunkSource().getGenerator(), _level.getRandom(), ${toBlockPos(input$x,input$y,input$z)}));
4+
.getHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, new ResourceLocation("${generator.map(field$feature, "configuredfeatures")}")))
5+
.value().place(_level, _level.getChunkSource().getGenerator(), _level.getRandom(), ${toBlockPos(input$x,input$y,input$z)});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<#include "mcelements.ftl">
22
(world instanceof ServerLevel _level${cbi} && _level${cbi}.registryAccess().registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY)
3-
.getHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, new ResourceLocation("${generator.map(field$feature, "configuredfeatures")}"))
4-
.value().place(_level${cbi}, _level${cbi}.getChunkSource().getGenerator(), _level${cbi}.getRandom(), ${toBlockPos(input$x,input$y,input$z)})))
3+
.getHolderOrThrow(ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, new ResourceLocation("${generator.map(field$feature, "configuredfeatures")}")))
4+
.value().place(_level${cbi}, _level${cbi}.getChunkSource().getGenerator(), _level${cbi}.getRandom(), ${toBlockPos(input$x,input$y,input$z)}))

src/main/resources/forge-1.19.2/templates/livingentity/livingentity.java.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public class ${name}Entity extends ${extendsClass} <#if interfaces?size gt 0>imp
286286
<#if data.raidCelebrationSound?has_content && data.raidCelebrationSound.getMappedValue()?has_content>
287287
return ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("${data.raidCelebrationSound}"));
288288
<#else>
289-
return SoundEvents.EMPTY;
289+
return null;
290290
</#if>
291291
}
292292
</#if>

src/main/resources/forge-1.19.2/workspacebase/build.gradle

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ tasks.withType(JavaCompile).configureEach {
4343
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
4444
}
4545

46-
<#if w.getGElementsOfType('biome')?filter(e -> e.spawnBiome || e.spawnInCaves || e.spawnBiomeNether)?size != 0>
4746
mixin {
48-
add sourceSets.main, "${modid}.refmap.json"
49-
config "${modid}.mixins.json"
47+
if (file("src/main/resources/${modid}.mixins.json").exists()) {
48+
add sourceSets.main, "${modid}.refmap.json"
49+
config "${modid}.mixins.json"
50+
}
5051
}
5152

5253
dependencies {
@@ -55,10 +56,11 @@ dependencies {
5556
}
5657

5758
jar {
58-
manifest.attributes([
59-
"MixinConfigs": "${modid}.mixins.json"
60-
])
59+
if (file("src/main/resources/${modid}.mixins.json").exists()) {
60+
manifest.attributes([
61+
"MixinConfigs": "${modid}.mixins.json"
62+
])
63+
}
6164
}
62-
</#if>
6365

6466
apply from: 'mcreator.gradle'

0 commit comments

Comments
 (0)