Update to 1.21.5
This commit is contained in:
+3
-3
@@ -4,13 +4,13 @@ org.gradle.parallel=true
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.8
|
||||
minecraft_version=1.21.5
|
||||
yarn_mappings=1.21.5+build.1
|
||||
loader_version=0.18.4
|
||||
loom_version=1.15-SNAPSHOT
|
||||
|
||||
# Fabric API
|
||||
fabric_version=0.119.4+1.21.4
|
||||
fabric_version=0.128.2+1.21.5
|
||||
|
||||
# Mod Properties
|
||||
mod_version=2.0.0
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:infernal_ashes"
|
||||
"recipe": "acesbs:infernal_ashes"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:infernal_ashes"
|
||||
"acesbs:infernal_ashes"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:prisma_steel"
|
||||
"recipe": "acesbs:prisma_steel"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:prisma_steel"
|
||||
"acesbs:prisma_steel"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:raw_endtropy"
|
||||
"recipe": "acesbs:raw_endtropy"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:raw_endtropy"
|
||||
"acesbs:raw_endtropy"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:raw_entropy"
|
||||
"recipe": "acesbs:raw_entropy"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:raw_entropy"
|
||||
"acesbs:raw_entropy"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:stable_endtropy"
|
||||
"recipe": "acesbs:stable_endtropy"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:stable_endtropy"
|
||||
"acesbs:stable_endtropy"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:stable_entropy"
|
||||
"recipe": "acesbs:stable_entropy"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:stable_entropy"
|
||||
"acesbs:stable_entropy"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:infernal_ashes_block"
|
||||
"recipe": "acesbs:infernal_ashes_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:infernal_ashes_block"
|
||||
"acesbs:infernal_ashes_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:prisma_steel_block"
|
||||
"recipe": "acesbs:prisma_steel_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:prisma_steel_block"
|
||||
"acesbs:prisma_steel_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:raw_endtropy_block"
|
||||
"recipe": "acesbs:raw_endtropy_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:raw_endtropy_block"
|
||||
"acesbs:raw_endtropy_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:raw_entropy_block"
|
||||
"recipe": "acesbs:raw_entropy_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:raw_entropy_block"
|
||||
"acesbs:raw_entropy_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:stable_endtropy_block"
|
||||
"recipe": "acesbs:stable_endtropy_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:stable_endtropy_block"
|
||||
"acesbs:stable_endtropy_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:stable_entropy_block"
|
||||
"recipe": "acesbs:stable_entropy_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:stable_entropy_block"
|
||||
"acesbs:stable_entropy_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:cooked_lemon_from_campfire_cooking"
|
||||
"recipe": "acesbs:cooked_lemon_from_campfire_cooking"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:cooked_lemon_from_campfire_cooking"
|
||||
"acesbs:cooked_lemon_from_campfire_cooking"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:cooked_lemon_from_smelting"
|
||||
"recipe": "acesbs:cooked_lemon_from_smelting"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:cooked_lemon_from_smelting"
|
||||
"acesbs:cooked_lemon_from_smelting"
|
||||
]
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:cooked_lemon_from_smoking"
|
||||
"recipe": "acesbs:cooked_lemon_from_smoking"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:cooked_lemon_from_smoking"
|
||||
"acesbs:cooked_lemon_from_smoking"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"type": "minecraft:smithing_trim",
|
||||
"addition": "#minecraft:trim_materials",
|
||||
"base": "#minecraft:trimmable_armor",
|
||||
"pattern": "acesbs:ashen",
|
||||
"template": "acesbs:ashen_armor_trim_smithing_template"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"type": "minecraft:smithing_trim",
|
||||
"addition": "#minecraft:trim_materials",
|
||||
"base": "#minecraft:trimmable_armor",
|
||||
"pattern": "acesbs:prisma",
|
||||
"template": "acesbs:prisma_armor_trim_smithing_template"
|
||||
}
|
||||
@@ -3,6 +3,5 @@
|
||||
"description": {
|
||||
"color": "#B93425",
|
||||
"translate": "trim_material.acesbs.ashen_steel"
|
||||
},
|
||||
"ingredient": "acesbs:ashen_steel"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,5 @@
|
||||
"description": {
|
||||
"color": "#B16491",
|
||||
"translate": "trim_material.acesbs.prisma_steel"
|
||||
},
|
||||
"ingredient": "acesbs:prisma_steel"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,5 @@
|
||||
"decal": false,
|
||||
"description": {
|
||||
"translate": "trim_pattern.acesbs.ashen"
|
||||
},
|
||||
"template_item": "acesbs:ashen_armor_trim_smithing_template"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,5 @@
|
||||
"decal": false,
|
||||
"description": {
|
||||
"translate": "trim_pattern.acesbs.prisma"
|
||||
},
|
||||
"template_item": "acesbs:prisma_armor_trim_smithing_template"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
attribute components on items and armor are not being applied.
|
||||
- Thot-begone
|
||||
- Beserkers Pauldon
|
||||
Command Core textures broken
|
||||
Command Core Broken
|
||||
|
||||
Armor is invisible
|
||||
Bricked Up does not do anything
|
||||
|
||||
Command Core textures broken
|
||||
Wildfire Particles missing
|
||||
|
||||
Particles not on server???
|
||||
@@ -8,30 +8,41 @@ import com.mojang.serialization.MapCodec;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.enums.NoteBlockInstrument;
|
||||
import net.minecraft.block.piston.PistonBehavior;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.tooltip.TooltipType;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.ToIntFunction;
|
||||
|
||||
public class ModBlocks {
|
||||
|
||||
public static final Block RAW_ENTROPY_BLOCK = registerBlock("raw_entropy_block",
|
||||
public static final Block RAW_ENTROPY_BLOCK = registerBlockWithTooltip("raw_entropy_block",
|
||||
properties -> new RawEntropyBlock(properties
|
||||
.strength(3f)
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)));
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)),
|
||||
List.of(Text.translatable("tooltip.acesbs.entropy_block.tooltip"),
|
||||
Text.translatable("tooltip.acesbs.entropy_block.tooltip2")));
|
||||
|
||||
public static final Block STABLE_ENTROPY_BLOCK = registerBlock("stable_entropy_block",
|
||||
public static final Block STABLE_ENTROPY_BLOCK = registerBlockWithTooltip("stable_entropy_block",
|
||||
properties -> new StableEntropyBlock(properties
|
||||
.strength(5f)
|
||||
.luminance(new ToIntFunction<BlockState>() {
|
||||
@@ -41,7 +52,9 @@ public class ModBlocks {
|
||||
}
|
||||
})
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.LODESTONE)));
|
||||
.sounds(BlockSoundGroup.LODESTONE)), List.of(Text.translatable("tooltip.acesbs.stable_entropy_block.tooltip")));
|
||||
|
||||
|
||||
|
||||
public static final Block ENTROPY_ORE = registerBlock("entropy_ore",
|
||||
properties -> new ExperienceDroppingBlock(UniformIntProvider.create(3, 7),
|
||||
@@ -66,17 +79,18 @@ public class ModBlocks {
|
||||
.requiresTool()
|
||||
.strength(3.0F, 9.0F)));
|
||||
|
||||
public static final Block RAW_ENDTROPY_BLOCK = registerBlock("raw_endtropy_block",
|
||||
public static final Block RAW_ENDTROPY_BLOCK = registerBlockWithTooltip("raw_endtropy_block",
|
||||
properties -> new RawEndtropyBlock(properties
|
||||
.strength(3f)
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)));
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)),
|
||||
List.of(Text.translatable("tooltip.acesbs.endtropy_block.tooltip")));
|
||||
|
||||
public static final Block STABLE_ENDTROPY_BLOCK = registerBlock("stable_endtropy_block",
|
||||
public static final Block STABLE_ENDTROPY_BLOCK = registerBlockWithTooltip("stable_endtropy_block",
|
||||
properties -> new StableEndtropyBlock(properties
|
||||
.strength(3f)
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)));
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)), List.of(Text.translatable("tooltip.acesbs.stable_endtropy_block.tooltip")));
|
||||
|
||||
public static final Block INFERNAL_ASHES_ORE = registerBlock("infernal_ashes_ore",
|
||||
properties -> new ExperienceDroppingBlock(
|
||||
@@ -135,7 +149,7 @@ public class ModBlocks {
|
||||
properties -> new PillarBlock(properties.mapColor(MapColor.PALE_YELLOW).instrument(NoteBlockInstrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()));
|
||||
|
||||
public static final Block LEMONWOOD_LEAVES = registerBlock("lemonwood_leaves",
|
||||
properties -> new LeavesBlock(properties.mapColor(MapColor.DARK_GREEN).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).burnable().pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never)));
|
||||
properties -> new UntintedParticleLeavesBlock(0.02f, ParticleTypes.PALE_OAK_LEAVES, properties.mapColor(MapColor.DARK_GREEN).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).burnable().pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never)));
|
||||
public static final Block LEMONWOOD_SAPLING = registerBlock("lemonwood_sapling",
|
||||
properties -> new SaplingBlock(ModBlockSaplingGenerator.LEMONWOOD, properties.mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY)));
|
||||
|
||||
@@ -293,6 +307,11 @@ public class ModBlocks {
|
||||
protected MapCodec<? extends FallingBlock> getCodec() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(BlockState state, BlockView world, BlockPos pos) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -349,6 +368,13 @@ public class ModBlocks {
|
||||
return Registry.register(Registries.BLOCK, Identifier.of(AcesBS.MOD_ID, name), toRegister);
|
||||
}
|
||||
|
||||
//Fuck you Devs for making it so blocks no longer have appendTooltip, makes shit much harder when I have to separately manage BlockItems.
|
||||
private static Block registerBlockWithTooltip(String name, Function<AbstractBlock.Settings, Block> function, List<Text> texts) {
|
||||
Block toRegister = function.apply(AbstractBlock.Settings.create().registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(AcesBS.MOD_ID, name))));
|
||||
registerBlockItemWithTootip(name, toRegister, texts);
|
||||
return Registry.register(Registries.BLOCK, Identifier.of(AcesBS.MOD_ID, name), toRegister);
|
||||
}
|
||||
|
||||
private static Block registerBlockWithoutItem(String name, Function<AbstractBlock.Settings, Block> function) {
|
||||
return Registry.register(Registries.BLOCK, Identifier.of(AcesBS.MOD_ID, name),
|
||||
function.apply(AbstractBlock.Settings.create().registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(AcesBS.MOD_ID, name)))));
|
||||
@@ -360,6 +386,21 @@ public class ModBlocks {
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(AcesBS.MOD_ID, name)))));
|
||||
}
|
||||
|
||||
private static void registerBlockItemWithTootip(String name, Block block, List<Text> texts) {
|
||||
Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name),
|
||||
new BlockItem(block, new Item.Settings().useBlockPrefixedTranslationKey()
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(AcesBS.MOD_ID, name)))){
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
for (Text text : texts){
|
||||
textConsumer.accept(text);
|
||||
}
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void registerModBlocks(){
|
||||
AcesBS.LOGGER.info("Registering Mod Blocks for " + AcesBS.MOD_ID);
|
||||
|
||||
|
||||
@@ -47,17 +47,6 @@ public class EntropicEntangler extends BlockWithEntity implements BlockEntityPro
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
if(state.getBlock() != newState.getBlock()) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if(blockEntity instanceof EntropicEntanglerEntity) {
|
||||
ItemScatterer.spawn(world, pos, ((EntropicEntanglerEntity) blockEntity));
|
||||
world.updateComparators(pos, this);
|
||||
}
|
||||
super.onStateReplaced(state, world, pos, newState, moved);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
|
||||
@@ -47,17 +47,6 @@ public class EntropicEviscerator extends BlockWithEntity implements BlockEntityP
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
if(state.getBlock() != newState.getBlock()) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if(blockEntity instanceof EntropicEvisceratorEntity) {
|
||||
ItemScatterer.spawn(world, pos, ((EntropicEvisceratorEntity) blockEntity));
|
||||
world.updateComparators(pos, this);
|
||||
}
|
||||
super.onStateReplaced(state, world, pos, newState, moved);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
|
||||
@@ -47,18 +47,6 @@ public class EntropicStabilizer extends BlockWithEntity implements BlockEntityPr
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
if(state.getBlock() != newState.getBlock()) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if(blockEntity instanceof EntropicStabilizerEntity) {
|
||||
ItemScatterer.spawn(world, pos, ((EntropicStabilizerEntity) blockEntity));
|
||||
world.updateComparators(pos, this);
|
||||
}
|
||||
super.onStateReplaced(state, world, pos, newState, moved);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.acethewildfire.acesbs.effect.ModEffects;
|
||||
import com.acethewildfire.acesbs.util.ModTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
@@ -24,6 +26,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class RawEndtropyBlock extends Block {
|
||||
public RawEndtropyBlock(Settings settings) {
|
||||
@@ -58,7 +61,7 @@ public class RawEndtropyBlock extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
|
||||
// Never take fall damage
|
||||
if (entity.bypassesLandingEffects()) {
|
||||
super.onLandedUpon(world, state, pos, entity, 0);
|
||||
@@ -66,10 +69,4 @@ public class RawEndtropyBlock extends Block {
|
||||
entity.handleFallDamage(fallDistance, 0.0F, world.getDamageSources().fall());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.endtropy_block.tooltip"));
|
||||
super.appendTooltip(stack, context, tooltip, options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class RawEntropyBlock extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
|
||||
// Never take fall damage
|
||||
if (entity.bypassesLandingEffects()) {
|
||||
super.onLandedUpon(world, state, pos, entity, 0);
|
||||
@@ -80,10 +80,4 @@ public class RawEntropyBlock extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.entropy_block.tooltip"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.entropy_block.tooltip2"));
|
||||
super.appendTooltip(stack, context, tooltip, options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class StableEndtropyBlock extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
|
||||
// Never take fall damage
|
||||
if (entity.bypassesLandingEffects()) {
|
||||
super.onLandedUpon(world, state, pos, entity, 0);
|
||||
@@ -57,10 +57,4 @@ public class StableEndtropyBlock extends Block {
|
||||
entity.handleFallDamage(fallDistance, 0.0F, world.getDamageSources().fall());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.stable_endtropy_block.tooltip"));
|
||||
super.appendTooltip(stack, context, tooltip, options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class StableEntropyBlock extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
|
||||
// Never take fall damage
|
||||
if (entity.bypassesLandingEffects()) {
|
||||
super.onLandedUpon(world, state, pos, entity, 0);
|
||||
@@ -47,10 +47,4 @@ public class StableEntropyBlock extends Block {
|
||||
entity.handleFallDamage(fallDistance, 0.0F, world.getDamageSources().fall());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, Item.TooltipContext context, List<Text> tooltip, TooltipType options) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.stable_entropy_block.tooltip"));
|
||||
super.appendTooltip(stack, context, tooltip, options);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-4
@@ -25,6 +25,7 @@ import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ItemScatterer;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
@@ -99,11 +100,17 @@ public class EntropicEntanglerEntity extends BlockEntity implements EntanglerInv
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockReplaced(BlockPos pos, BlockState oldState) {
|
||||
ItemScatterer.spawn(world, pos, (this));
|
||||
super.onBlockReplaced(pos, oldState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
super.writeNbt(nbt, registryLookup);
|
||||
Inventories.writeNbt(nbt, inventory, registryLookup);
|
||||
nbt.putInt("Facing", facing.getId());
|
||||
nbt.putString("Facing", facing.getId());
|
||||
// nbt.putInt("entangler.fuel_progress", fuel_progress);
|
||||
// nbt.putInt("entangler.fuel_max_progress", fuel_max_progress);
|
||||
nbt.putInt("entangler.entangle_progress", entangle_progress);
|
||||
@@ -113,11 +120,11 @@ public class EntropicEntanglerEntity extends BlockEntity implements EntanglerInv
|
||||
@Override
|
||||
protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
Inventories.readNbt(nbt, inventory, registryLookup);
|
||||
this.facing = Direction.byId(nbt.getInt("Facing"));
|
||||
this.facing = Direction.byId(nbt.getString("Facing").get());
|
||||
// this.fuel_progress = nbt.getInt("entangler.fuel_progress");
|
||||
// this.fuel_max_progress = nbt.getInt("entangler.fuel_max_progress");
|
||||
this.entangle_progress = nbt.getInt("entangler.entangle_progress");
|
||||
this.entangle_max_progress = nbt.getInt("entangler.entangle_max_progress");
|
||||
this.entangle_progress = nbt.getInt("entangler.entangle_progress").get();
|
||||
this.entangle_max_progress = nbt.getInt("entangler.entangle_max_progress").get();
|
||||
super.readNbt(nbt, registryLookup);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -104,7 +104,7 @@ public class EntropicEvisceratorEntity extends BlockEntity implements Implemente
|
||||
protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
super.writeNbt(nbt, registryLookup);
|
||||
Inventories.writeNbt(nbt, inventory, registryLookup);
|
||||
nbt.putInt("Facing", facing.getId());
|
||||
nbt.putString("Facing", facing.getId());
|
||||
nbt.putInt("eviscerator.fuel_progress", fuel_progress);
|
||||
nbt.putInt("eviscerator.fuel_max_progress", fuel_max_progress);
|
||||
nbt.putInt("eviscerator.eviscerate_progress", eviscerate_progress);
|
||||
@@ -114,11 +114,11 @@ public class EntropicEvisceratorEntity extends BlockEntity implements Implemente
|
||||
@Override
|
||||
protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
Inventories.readNbt(nbt, inventory, registryLookup);
|
||||
this.facing = Direction.byId(nbt.getInt("Facing"));
|
||||
this.fuel_progress = nbt.getInt("eviscerator.fuel_progress");
|
||||
this.fuel_max_progress = nbt.getInt("eviscerator.fuel_max_progress");
|
||||
this.eviscerate_progress = nbt.getInt("eviscerator.eviscerate_progress");
|
||||
this.eviscerate_max_progress = nbt.getInt("eviscerator.eviscerate_max_progress");
|
||||
this.facing = Direction.byId(nbt.getString("Facing").get());
|
||||
this.fuel_progress = nbt.getInt("eviscerator.fuel_progress").get();
|
||||
this.fuel_max_progress = nbt.getInt("eviscerator.fuel_max_progress").get();
|
||||
this.eviscerate_progress = nbt.getInt("eviscerator.eviscerate_progress").get();
|
||||
this.eviscerate_max_progress = nbt.getInt("eviscerator.eviscerate_max_progress").get();
|
||||
super.readNbt(nbt, registryLookup);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -104,7 +104,7 @@ public class EntropicStabilizerEntity extends BlockEntity implements Implemented
|
||||
protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
super.writeNbt(nbt, registryLookup);
|
||||
Inventories.writeNbt(nbt, inventory, registryLookup);
|
||||
nbt.putInt("Facing", facing.getId());
|
||||
nbt.putString("Facing", facing.getId());
|
||||
nbt.putInt("stabilizer.fuel_progress", fuel_progress);
|
||||
nbt.putInt("stabilizer.fuel_max_progress", fuel_max_progress);
|
||||
nbt.putInt("stabilizer.stabilize_progress", stabilize_progress);
|
||||
@@ -114,11 +114,11 @@ public class EntropicStabilizerEntity extends BlockEntity implements Implemented
|
||||
@Override
|
||||
protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) {
|
||||
Inventories.readNbt(nbt, inventory, registryLookup);
|
||||
this.facing = Direction.byId(nbt.getInt("Facing"));
|
||||
this.fuel_progress = nbt.getInt("stabilizer.fuel_progress");
|
||||
this.fuel_max_progress = nbt.getInt("stabilizer.fuel_max_progress");
|
||||
this.stabilize_progress = nbt.getInt("stabilizer.stabilize_progress");
|
||||
this.stabilize_max_progress = nbt.getInt("stabilizer.stabilize_max_progress");
|
||||
this.facing = Direction.byId(nbt.getString("Facing").get());
|
||||
this.fuel_progress = nbt.getInt("stabilizer.fuel_progress").get();
|
||||
this.fuel_max_progress = nbt.getInt("stabilizer.fuel_max_progress").get();
|
||||
this.stabilize_progress = nbt.getInt("stabilizer.stabilize_progress").get();
|
||||
this.stabilize_max_progress = nbt.getInt("stabilizer.stabilize_max_progress").get();
|
||||
super.readNbt(nbt, registryLookup);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,11 @@ import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
|
||||
import net.minecraft.loot.provider.number.UniformLootNumberProvider;
|
||||
import net.minecraft.predicate.NumberRange;
|
||||
import net.minecraft.predicate.StatePredicate;
|
||||
import net.minecraft.predicate.component.ComponentPredicateTypes;
|
||||
import net.minecraft.predicate.component.ComponentsPredicate;
|
||||
import net.minecraft.predicate.item.EnchantmentPredicate;
|
||||
import net.minecraft.predicate.item.EnchantmentsPredicate;
|
||||
import net.minecraft.predicate.item.ItemPredicate;
|
||||
import net.minecraft.predicate.item.ItemSubPredicateTypes;
|
||||
import net.minecraft.registry.RegistryEntryLookup;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
@@ -119,11 +120,14 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
|
||||
RegistryWrapper.Impl<Enchantment> impl = this.registries.getOrThrow(RegistryKeys.ENCHANTMENT);
|
||||
RegistryEntryLookup<Item> itemLookup = registries.getOrThrow(RegistryKeys.ITEM);
|
||||
LootCondition.Builder silkTouchCondition = MatchToolLootCondition.builder(
|
||||
ItemPredicate.Builder.create()
|
||||
.subPredicate(
|
||||
ItemSubPredicateTypes.ENCHANTMENTS,
|
||||
EnchantmentsPredicate.enchantments(List.of(new EnchantmentPredicate(impl.getOrThrow(Enchantments.SILK_TOUCH), NumberRange.IntRange.atLeast(1))))
|
||||
)
|
||||
ItemPredicate.Builder.create().components(
|
||||
ComponentsPredicate.Builder.create()
|
||||
.partial(
|
||||
ComponentPredicateTypes.ENCHANTMENTS,
|
||||
EnchantmentsPredicate.enchantments(
|
||||
List.of(new EnchantmentPredicate(impl.getOrThrow(Enchantments.SILK_TOUCH), NumberRange.IntRange.atLeast(1)))))
|
||||
.build()
|
||||
)
|
||||
);
|
||||
|
||||
LootPool.Builder defaultPool = LootPool.builder()
|
||||
|
||||
@@ -15,8 +15,10 @@ import net.minecraft.client.item.ItemAsset;
|
||||
import net.minecraft.client.render.item.model.ConditionItemModel;
|
||||
import net.minecraft.client.render.item.model.ItemModel;
|
||||
import net.minecraft.client.render.item.property.bool.HasComponentProperty;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.client.render.model.json.ModelVariant;
|
||||
import net.minecraft.client.render.model.json.WeightedVariant;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.Pool;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -60,8 +62,8 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
lemonwoodPool.fenceGate(ModBlocks.LEMONWOOD_FENCE_GATE);
|
||||
lemonwoodPool.wall(ModBlocks.LEMONWOOD_WALL);
|
||||
|
||||
blockStateModelGenerator.registerLog(ModBlocks.LEMONWOOD_LOG).log(ModBlocks.LEMONWOOD_LOG).wood(ModBlocks.LEMONWOOD_WOOD);
|
||||
blockStateModelGenerator.registerLog(ModBlocks.STRIPPED_LEMONWOOD_LOG).log(ModBlocks.STRIPPED_LEMONWOOD_LOG).wood(ModBlocks.STRIPPED_LEMONWOOD_WOOD);
|
||||
blockStateModelGenerator.createLogTexturePool(ModBlocks.LEMONWOOD_LOG).log(ModBlocks.LEMONWOOD_LOG).wood(ModBlocks.LEMONWOOD_WOOD);
|
||||
blockStateModelGenerator.createLogTexturePool(ModBlocks.STRIPPED_LEMONWOOD_LOG).log(ModBlocks.STRIPPED_LEMONWOOD_LOG).wood(ModBlocks.STRIPPED_LEMONWOOD_WOOD);
|
||||
|
||||
blockStateModelGenerator.registerSingleton(ModBlocks.LEMONWOOD_LEAVES, TexturedModel.LEAVES);
|
||||
// blockStateModelGenerator.registerTintableCross(ModBlocks.LEMONWOOD_SAPLING, BlockStateModelGenerator.TintType.NOT_TINTED);
|
||||
@@ -72,8 +74,10 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
|
||||
Identifier lampOffIdentifier = TexturedModel.CUBE_ALL.upload(ModBlocks.EVIL_BLOCK, blockStateModelGenerator.modelCollector);
|
||||
Identifier lampOnIdentifier = blockStateModelGenerator.createSubModel(ModBlocks.EVIL_BLOCK, "_on", Models.CUBE_ALL, TextureMap::all);
|
||||
blockStateModelGenerator.blockStateCollector.accept(VariantsBlockStateSupplier.create(ModBlocks.EVIL_BLOCK)
|
||||
.coordinate(BlockStateModelGenerator.createBooleanModelMap(EvilBlock.CLICKED, lampOnIdentifier, lampOffIdentifier)));
|
||||
blockStateModelGenerator.blockStateCollector.accept(VariantsBlockModelDefinitionCreator.of(ModBlocks.EVIL_BLOCK)
|
||||
.with(BlockStateModelGenerator.createBooleanModelMap(EvilBlock.CLICKED,
|
||||
new WeightedVariant(Pool.<ModelVariant>builder().add(new ModelVariant(lampOnIdentifier)).build()),
|
||||
new WeightedVariant(Pool.<ModelVariant>builder().add(new ModelVariant(lampOffIdentifier)).build()))));
|
||||
|
||||
blockStateModelGenerator.registerCrop(ModBlocks.TOBACCO_CROP, TobaccoCrop.AGE, 0,1,2,3,4,5,6);
|
||||
}
|
||||
@@ -114,10 +118,10 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
itemModelGenerator.register(PrismaSteelItems.PRISMA_STEEL_SHOVEL, Models.HANDHELD);
|
||||
itemModelGenerator.register(PrismaSteelItems.PRISMA_STEEL_HOE, Models.HANDHELD);
|
||||
|
||||
itemModelGenerator.registerArmor(((ArmorItem) PrismaSteelItems.PRISMA_STEEL_HELMET), ModArmorMaterials.PRISMA_KEY, "helmet", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) PrismaSteelItems.PRISMA_STEEL_CHESTPLATE), ModArmorMaterials.PRISMA_KEY, "chestplate", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) PrismaSteelItems.PRISMA_STEEL_LEGGINGS), ModArmorMaterials.PRISMA_KEY, "leggings", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) PrismaSteelItems.PRISMA_STEEL_BOOTS), ModArmorMaterials.PRISMA_KEY, "boots", false);
|
||||
itemModelGenerator.registerArmor((PrismaSteelItems.PRISMA_STEEL_HELMET), ModArmorMaterials.PRISMA_KEY, ItemModelGenerator.HELMET_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor((PrismaSteelItems.PRISMA_STEEL_CHESTPLATE), ModArmorMaterials.PRISMA_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor((PrismaSteelItems.PRISMA_STEEL_LEGGINGS), ModArmorMaterials.PRISMA_KEY, ItemModelGenerator.LEGGINGS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor((PrismaSteelItems.PRISMA_STEEL_BOOTS), ModArmorMaterials.PRISMA_KEY, ItemModelGenerator.BOOTS_TRIM_ID_PREFIX, false);
|
||||
|
||||
itemModelGenerator.register(AshenSteelItems.ASHEN_STEEL_SWORD, Models.HANDHELD);
|
||||
itemModelGenerator.register(AshenSteelItems.ASHEN_STEEL_PICKAXE, Models.HANDHELD);
|
||||
@@ -126,14 +130,14 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
itemModelGenerator.register(AshenSteelItems.ASHEN_STEEL_SHOVEL, Models.HANDHELD);
|
||||
itemModelGenerator.register(AshenSteelItems.ASHEN_STEEL_HOE, Models.HANDHELD);
|
||||
|
||||
itemModelGenerator.registerArmor(((ArmorItem) AshenSteelItems.ASHEN_STEEL_HELMET), ModArmorMaterials.ASHEN_KEY, "helmet", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) AshenSteelItems.ASHEN_STEEL_CHESTPLATE), ModArmorMaterials.ASHEN_KEY, "chestplate", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) AshenSteelItems.ASHEN_STEEL_LEGGINGS), ModArmorMaterials.ASHEN_KEY, "leggings", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) AshenSteelItems.ASHEN_STEEL_BOOTS), ModArmorMaterials.ASHEN_KEY, "boots", false);
|
||||
itemModelGenerator.registerArmor(( AshenSteelItems.ASHEN_STEEL_HELMET), ModArmorMaterials.ASHEN_KEY, ItemModelGenerator.HELMET_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(( AshenSteelItems.ASHEN_STEEL_CHESTPLATE), ModArmorMaterials.ASHEN_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(( AshenSteelItems.ASHEN_STEEL_LEGGINGS), ModArmorMaterials.ASHEN_KEY, ItemModelGenerator.LEGGINGS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(( AshenSteelItems.ASHEN_STEEL_BOOTS), ModArmorMaterials.ASHEN_KEY, ItemModelGenerator.BOOTS_TRIM_ID_PREFIX, false);
|
||||
|
||||
itemModelGenerator.registerArmor(((ArmorItem) ModItems.BERSERKERS_PAULDRON), ModArmorMaterials.BERSERKERS_KEY, "chestplate", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) ModItems.WILDFIRE_BOOTS), ModArmorMaterials.WILDFIRE_KEY, "boots", false);
|
||||
itemModelGenerator.registerArmor(((ArmorItem) ModItems.SOVS_PLATE_CARRIER), ModArmorMaterials.PLATES_KEY, "chestplate", false);
|
||||
itemModelGenerator.registerArmor(( ModItems.BERSERKERS_PAULDRON), ModArmorMaterials.BERSERKERS_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(( ModItems.WILDFIRE_BOOTS), ModArmorMaterials.WILDFIRE_KEY, ItemModelGenerator.BOOTS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(( ModItems.SOVS_PLATE_CARRIER), ModArmorMaterials.PLATES_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
|
||||
itemModelGenerator.register(ModItems.FREN_SPAWN_EGG,
|
||||
new Model(Optional.of(Identifier.of("item/template_spawn_egg")), Optional.empty()));
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.acethewildfire.acesbs.block.ModBlocks;
|
||||
import com.acethewildfire.acesbs.item.AshenSteelItems;
|
||||
import com.acethewildfire.acesbs.item.ModItems;
|
||||
import com.acethewildfire.acesbs.item.PrismaSteelItems;
|
||||
import com.acethewildfire.acesbs.trim.ModTrimPatterns;
|
||||
import com.acethewildfire.acesbs.util.ModTags;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||
@@ -260,8 +261,8 @@ public class ModRecipeProvider extends FabricRecipeProvider {
|
||||
ModArmorRecipeJsonBuilder(recipeExporter, PrismaSteelItems.PRISMA_STEEL_HELMET, PrismaSteelItems.PRISMA_STEEL_CHESTPLATE, PrismaSteelItems.PRISMA_STEEL_LEGGINGS, PrismaSteelItems.PRISMA_STEEL_BOOTS, PrismaSteelItems.PRISMA_STEEL, PrismaSteelItems.PRISMA_STEEL);
|
||||
ModArmorRecipeJsonBuilder(recipeExporter, AshenSteelItems.ASHEN_STEEL_HELMET, AshenSteelItems.ASHEN_STEEL_CHESTPLATE, AshenSteelItems.ASHEN_STEEL_LEGGINGS, AshenSteelItems.ASHEN_STEEL_BOOTS, AshenSteelItems.ASHEN_STEEL, AshenSteelItems.ASHEN_STEEL);
|
||||
|
||||
offerSmithingTrimRecipe(PrismaSteelItems.PRISMA_SMITHING_TEMPLATE, RegistryKey.of(RegistryKeys.RECIPE, Identifier.of(AcesBS.MOD_ID, "prisma")));
|
||||
offerSmithingTrimRecipe(AshenSteelItems.ASHEN_SMITHING_TEMPLATE, RegistryKey.of(RegistryKeys.RECIPE, Identifier.of(AcesBS.MOD_ID, "ashen")));
|
||||
offerSmithingTrimRecipe(PrismaSteelItems.PRISMA_SMITHING_TEMPLATE, ModTrimPatterns.PRISMA, RegistryKey.of(RegistryKeys.RECIPE, Identifier.of(AcesBS.MOD_ID, "prisma")));
|
||||
offerSmithingTrimRecipe(AshenSteelItems.ASHEN_SMITHING_TEMPLATE, ModTrimPatterns.ASHEN, RegistryKey.of(RegistryKeys.RECIPE, Identifier.of(AcesBS.MOD_ID, "ashen")));
|
||||
|
||||
// For 2+ recipes with the same RESULT use
|
||||
// .offerTo(recipeExporter, Identifier.of(AcesBS.MOD_ID, "output_item_from_input_item"));
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CombustibleLemonModel extends EntityModel<CombustibleLemonState> {
|
||||
.uv(64, 64).cuboid(-5.0F, -10.0F, -5.0F, 10.0F, 20.0F, 10.0F, new Dilation(-6.0F))
|
||||
.uv(0, 66).cuboid(-3.0F, -11.0F, -3.0F, 6.0F, 2.0F, 6.0F, new Dilation(-3.0F))
|
||||
.uv(24, 66).cuboid(3.0F, -9.0F, -6.0F, 4.0F, 3.0F, 4.0F, new Dilation(-2.0F))
|
||||
.uv(40, 66).cuboid(4.0F, -11.0F, -6.0F, 3.0F, 4.0F, 3.0F, new Dilation(-2.0F)), ModelTransform.pivot(0.0F, 9.0F, 0.0F));
|
||||
.uv(40, 66).cuboid(4.0F, -11.0F, -6.0F, 3.0F, 4.0F, 3.0F, new Dilation(-2.0F)), ModelTransform.rotation(0.0F, 9.0F, 0.0F));
|
||||
return TexturedModelData.of(modelData, 128, 128);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FrenAnimations {
|
||||
new Keyframe(0.0F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(1.0F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR)
|
||||
))
|
||||
.addBoneAnimation("head", new Transformation(Transformation.Targets.TRANSLATE,
|
||||
.addBoneAnimation("head", new Transformation(Transformation.Targets.MOVE_ORIGIN,
|
||||
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(0.5F, AnimationHelper.createTranslationalVector(0.0F, -0.25F, 0.0F), Transformation.Interpolations.LINEAR),
|
||||
new Keyframe(1.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR)
|
||||
|
||||
@@ -33,19 +33,19 @@ public class FrenModel extends EntityModel<FrenState> {
|
||||
public static TexturedModelData getTexturedModelData() {
|
||||
ModelData modelData = new ModelData();
|
||||
ModelPartData modelPartData = modelData.getRoot();
|
||||
ModelPartData root = modelPartData.addChild("root", ModelPartBuilder.create(), ModelTransform.pivot(0.0F, 17.0F, 0.0F));
|
||||
ModelPartData root = modelPartData.addChild("root", ModelPartBuilder.create(), ModelTransform.rotation(0.0F, 17.0F, 0.0F));
|
||||
|
||||
ModelPartData head = root.addChild("head", ModelPartBuilder.create().uv(0, 0).cuboid(-4.0F, -7.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, -12.0F, 0.0F));
|
||||
ModelPartData head = root.addChild("head", ModelPartBuilder.create().uv(0, 0).cuboid(-4.0F, -7.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(0.0F)), ModelTransform.rotation(0.0F, -12.0F, 0.0F));
|
||||
|
||||
ModelPartData body = root.addChild("body", ModelPartBuilder.create().uv(16, 16).cuboid(-4.0F, -18.0F, -2.0F, 8.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 7.0F, 0.0F));
|
||||
ModelPartData body = root.addChild("body", ModelPartBuilder.create().uv(16, 16).cuboid(-4.0F, -18.0F, -2.0F, 8.0F, 12.0F, 4.0F, new Dilation(0.0F)), ModelTransform.rotation(0.0F, 7.0F, 0.0F));
|
||||
|
||||
ModelPartData leg1 = root.addChild("leg1", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(-2.0F, 1.0F, 2.0F));
|
||||
ModelPartData leg1 = root.addChild("leg1", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.rotation(-2.0F, 1.0F, 2.0F));
|
||||
|
||||
ModelPartData leg2 = root.addChild("leg2", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(2.0F, 1.0F, 2.0F));
|
||||
ModelPartData leg2 = root.addChild("leg2", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.rotation(2.0F, 1.0F, 2.0F));
|
||||
|
||||
ModelPartData leg4 = root.addChild("leg4", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, -4.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(2.0F, 1.0F, -2.0F));
|
||||
ModelPartData leg4 = root.addChild("leg4", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, -4.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.rotation(2.0F, 1.0F, -2.0F));
|
||||
|
||||
ModelPartData leg3 = root.addChild("leg3", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, -4.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.pivot(-2.0F, 1.0F, -2.0F));
|
||||
ModelPartData leg3 = root.addChild("leg3", ModelPartBuilder.create().uv(0, 16).cuboid(-2.0F, 0.0F, -4.0F, 4.0F, 6.0F, 4.0F, new Dilation(0.0F)), ModelTransform.rotation(-2.0F, 1.0F, -2.0F));
|
||||
return TexturedModelData.of(modelData, 64, 32);
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ public class FrenModel extends EntityModel<FrenState> {
|
||||
@Override
|
||||
public void setAngles(FrenState state) {
|
||||
super.setAngles(state);
|
||||
this.setHeadAngles(state.yawDegrees, state.pitch);
|
||||
this.setHeadAngles(state.relativeHeadYaw, state.pitch);
|
||||
|
||||
this.animateWalking(FrenAnimations.ANIM_FREN_WALK, state.limbFrequency, state.limbAmplitudeMultiplier, 2f, 2.5f);
|
||||
this.animateWalking(FrenAnimations.ANIM_FREN_WALK, state.limbSwingAnimationProgress, state.limbSwingAmplitude, 2f, 2.5f);
|
||||
this.animate(state.idleAnimationState, FrenAnimations.ANIM_FREN_IDLE, state.age, 1f);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ public class AshenSteelItems {
|
||||
|
||||
public static final Item ASHEN_STEEL = ModItems.registerItem("ashen_steel", Item::new);
|
||||
public static final Item ASHEN_STEEL_SWORD = ModItems.registerItem("ashen_steel_sword",
|
||||
setting -> new SwordItem(ModToolMaterials.ASHEN_STEEL, 3, -2.4f, setting));
|
||||
setting -> new Item(setting.sword(ModToolMaterials.ASHEN_STEEL, 3, -2.4f)));
|
||||
public static final Item ASHEN_STEEL_SHOVEL = ModItems.registerItem("ashen_steel_shovel",
|
||||
setting -> new ShovelItem(ModToolMaterials.ASHEN_STEEL, 1.5F, -3.0F, setting));
|
||||
public static final Item ASHEN_STEEL_PICKAXE = ModItems.registerItem("ashen_steel_pickaxe",
|
||||
setting -> new PickaxeItem(ModToolMaterials.ASHEN_STEEL, 1.0F, -2.8F, setting));
|
||||
setting -> new Item(setting.pickaxe(ModToolMaterials.ASHEN_STEEL, 1.0F, -2.8F)));
|
||||
public static final Item ASHEN_STEEL_HAMMER = ModItems.registerItem("ashen_steel_hammer",
|
||||
setting -> new HammerItem(ModToolMaterials.ASHEN_STEEL, 7.0F, -3.4F, setting));
|
||||
public static final Item ASHEN_STEEL_AXE = ModItems.registerItem("ashen_steel_axe",
|
||||
@@ -24,16 +24,20 @@ public class AshenSteelItems {
|
||||
public static final Item ASHEN_STEEL_HOE = ModItems.registerItem("ashen_steel_hoe",
|
||||
setting -> new HoeItem(ModToolMaterials.ASHEN_STEEL, -2.0F, -1.0F, setting));
|
||||
public static final Item ASHEN_STEEL_HELMET = ModItems.registerItem("ashen_steel_helmet",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.HELMET, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.HELMET)
|
||||
.maxDamage(EquipmentType.HELMET.getMaxDamage(15))));
|
||||
public static final Item ASHEN_STEEL_CHESTPLATE = ModItems.registerItem("ashen_steel_chestplate",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.CHESTPLATE, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)
|
||||
.maxDamage(EquipmentType.CHESTPLATE.getMaxDamage(15))));
|
||||
public static final Item ASHEN_STEEL_LEGGINGS = ModItems.registerItem("ashen_steel_leggings",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.LEGGINGS, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.LEGGINGS)
|
||||
.maxDamage(EquipmentType.LEGGINGS.getMaxDamage(15))));
|
||||
public static final Item ASHEN_STEEL_BOOTS = ModItems.registerItem("ashen_steel_boots",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.BOOTS, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.ASHEN_STEEL_ARMOR_MATERIAL, EquipmentType.BOOTS)
|
||||
.maxDamage(EquipmentType.BOOTS.getMaxDamage(15))));
|
||||
public static final Item ASHEN_SMITHING_TEMPLATE = ModItems.registerItem("ashen_armor_trim_smithing_template",
|
||||
SmithingTemplateItem::of);
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.acethewildfire.acesbs.item;
|
||||
import com.acethewildfire.acesbs.AcesBS;
|
||||
import com.acethewildfire.acesbs.util.ModTags;
|
||||
import net.minecraft.client.render.entity.equipment.EquipmentModel;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.item.equipment.EquipmentAsset;
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ModItems {
|
||||
@@ -65,10 +66,10 @@ public class ModItems {
|
||||
public static final Item COMBUSTIBLE_LEMON = registerItem("combustible_lemon",
|
||||
setting -> new CombustibleLemon(setting.maxCount(16)){
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.combustible_lemon1"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.combustible_lemon2"));
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.combustible_lemon1"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.combustible_lemon2"));
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -76,35 +77,35 @@ public class ModItems {
|
||||
public static final Item COOKED_LEMON = registerItem("cooked_lemon", setting -> new Item(setting.food(ModFoodComponent.COOKED_LEMON)));
|
||||
public static final Item GREEN_BRICKS = registerItem("green_bricks", setting -> new Item(setting) {
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
}
|
||||
else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.green_bricks"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.green_bricks"));
|
||||
}
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
public static final Item MOTE_OF_ORDER = registerItem("mote_of_order", setting -> new Item(setting) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.mote_of_order"));
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.mote_of_order"));
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
public static final Item DUST_OF_ORDER = registerItem("dust_of_order", setting -> new Item(setting) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.dust_of_order"));
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.dust_of_order"));
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
public static final Item INGOT_OF_ORDER = registerItem("ingot_of_order", setting -> new Item(setting) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.ingot_of_order"));
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.ingot_of_order"));
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -113,21 +114,21 @@ public class ModItems {
|
||||
public static final Item KAUPEN_BOW = registerItem("kaupen_bow",
|
||||
setting -> new BowItem(setting.maxDamage(500)) {
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
}
|
||||
else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.kaupen_bow"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.kaupen_bow_2"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.kaupen_bow"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.kaupen_bow_2"));
|
||||
}
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
public static final Item THOT_BEGONE = ModItems.registerItem("thot_begone",
|
||||
setting -> new SwordItem(ToolMaterial.WOOD, 0, -1.4f, setting.attributeModifiers(
|
||||
setting -> new Item(setting.sword(ToolMaterial.WOOD, 0, -1.4f).attributeModifiers(
|
||||
AttributeModifiersComponent.builder()
|
||||
.add(EntityAttributes.ATTACK_KNOCKBACK, new EntityAttributeModifier(Identifier.of(AcesBS.MOD_ID, "attack.attack_knockback"), 25, EntityAttributeModifier.Operation.ADD_VALUE), AttributeModifierSlot.MAINHAND)
|
||||
.add(EntityAttributes.ATTACK_DAMAGE, new EntityAttributeModifier(Identifier.of(AcesBS.MOD_ID, "generic.attack_damage"), -0.999, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL), AttributeModifierSlot.MAINHAND)
|
||||
@@ -140,7 +141,8 @@ public class ModItems {
|
||||
|
||||
|
||||
public static final Item BERSERKERS_PAULDRON = registerItem("berserkers_pauldron",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.BERSERKERS_ARMOR_MATERIAL, EquipmentType.CHESTPLATE, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.BERSERKERS_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)
|
||||
.maxDamage(EquipmentType.CHESTPLATE.getMaxDamage(15))
|
||||
.attributeModifiers(AttributeModifiersComponent.builder()
|
||||
.add(EntityAttributes.MAX_HEALTH,
|
||||
@@ -151,52 +153,54 @@ public class ModItems {
|
||||
new EntityAttributeModifier(Identifier.of(AcesBS.MOD_ID, "generic.knockback_resistance"), 1.0f, EntityAttributeModifier.Operation.ADD_VALUE), AttributeModifierSlot.CHEST)
|
||||
.build())){
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.berserkers_pauldron_desc"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.berserkers_pauldron_desc"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
}
|
||||
else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.berserkers_pauldron_thanks"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.thanks_sov"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.berserkers_pauldron_thanks"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.thanks_sov"));
|
||||
}
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
public static final Item SOVS_PLATE_CARRIER = ModItems.registerItem("sovs_plate_carrier",
|
||||
setting -> new SovsPlateCarrierArmorItem(ModArmorMaterials.PLATES_ARMOR_MATERIAL, EquipmentType.CHESTPLATE, setting
|
||||
setting -> new SovsPlateCarrierArmorItem(setting
|
||||
.armor(ModArmorMaterials.PLATES_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)
|
||||
.maxDamage(6)){
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
}
|
||||
else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_thanks"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc2"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc3"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.sovs_plate_carrier_thanks"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc2"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc3"));
|
||||
}
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
});
|
||||
|
||||
public static final Item WILDFIRE_BOOTS = registerItem("wildfire_boots",
|
||||
setting -> new WildfireArmorItem(ModArmorMaterials.WILDFIRE_ARMOR_MATERIAL, EquipmentType.BOOTS, setting
|
||||
setting -> new WildfireArmorItem(setting
|
||||
.armor(ModArmorMaterials.WILDFIRE_ARMOR_MATERIAL, EquipmentType.BOOTS)
|
||||
.maxDamage(EquipmentType.BOOTS.getMaxDamage(15))){
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.wildfire_boots_desc"));
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.wildfire_boots_desc"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_more"));
|
||||
}
|
||||
else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.wildfire_boots_thanks"));
|
||||
// tooltip.add(Text.translatable("tooltip.acesbs.thanks_sov"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.wildfire_boots_thanks"));
|
||||
// textConsumer.accept(Text.translatable("tooltip.acesbs.thanks_sov"));
|
||||
}
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -232,7 +236,7 @@ public class ModItems {
|
||||
|
||||
// To you who reads this now, weep, as I did when I created this monster whom I have become
|
||||
if (!world.isClient && entity instanceof LivingEntity target) {
|
||||
for (ItemStack stack : player.getInventory().main) {
|
||||
for (ItemStack stack : player.getInventory().getMainStacks()) {
|
||||
if (stack.isOf(ModItems.COMMAND_CORE)) {
|
||||
if (Boolean.TRUE.equals(stack.get(ModDataComponentTypes.COMMAND_ACTIVE))){
|
||||
if (Objects.equals(stack.get(ModDataComponentTypes.COMMAND), "Omnipotence")){
|
||||
|
||||
@@ -10,11 +10,11 @@ public class PrismaSteelItems {
|
||||
|
||||
public static final Item PRISMA_STEEL = ModItems.registerItem("prisma_steel", Item::new);
|
||||
public static final Item PRISMA_STEEL_SWORD = ModItems.registerItem("prisma_steel_sword",
|
||||
setting -> new SwordItem(ModToolMaterials.PRISMA_STEEL, 3, -2.4f, setting));
|
||||
setting -> new Item(setting.sword(ModToolMaterials.PRISMA_STEEL, 3, -2.4f)));
|
||||
public static final Item PRISMA_STEEL_SHOVEL = ModItems.registerItem("prisma_steel_shovel",
|
||||
setting -> new ShovelItem(ModToolMaterials.PRISMA_STEEL, 1.5F, -3.0F, setting));
|
||||
public static final Item PRISMA_STEEL_PICKAXE = ModItems.registerItem("prisma_steel_pickaxe",
|
||||
setting -> new PickaxeItem(ModToolMaterials.PRISMA_STEEL, 1.0F, -2.8F, setting));
|
||||
setting -> new Item(setting.pickaxe(ModToolMaterials.PRISMA_STEEL, 1.0F, -2.8F)));
|
||||
public static final Item PRISMA_STEEL_HAMMER = ModItems.registerItem("prisma_steel_hammer",
|
||||
setting -> new HammerItem(ModToolMaterials.PRISMA_STEEL, 7.0F, -3.4F, setting));
|
||||
public static final Item PRISMA_STEEL_AXE = ModItems.registerItem("prisma_steel_axe",
|
||||
@@ -22,16 +22,20 @@ public class PrismaSteelItems {
|
||||
public static final Item PRISMA_STEEL_HOE = ModItems.registerItem("prisma_steel_hoe",
|
||||
setting -> new HoeItem(ModToolMaterials.PRISMA_STEEL, -2.0F, -1.0F, setting));
|
||||
public static final Item PRISMA_STEEL_HELMET = ModItems.registerItem("prisma_steel_helmet",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.HELMET, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.HELMET)
|
||||
.maxDamage(EquipmentType.HELMET.getMaxDamage(15))));
|
||||
public static final Item PRISMA_STEEL_CHESTPLATE = ModItems.registerItem("prisma_steel_chestplate",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.CHESTPLATE, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)
|
||||
.maxDamage(EquipmentType.CHESTPLATE.getMaxDamage(15))));
|
||||
public static final Item PRISMA_STEEL_LEGGINGS = ModItems.registerItem("prisma_steel_leggings",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.LEGGINGS, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.LEGGINGS)
|
||||
.maxDamage(EquipmentType.LEGGINGS.getMaxDamage(15))));
|
||||
public static final Item PRISMA_STEEL_BOOTS = ModItems.registerItem("prisma_steel_boots",
|
||||
setting -> new ModArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.BOOTS, setting
|
||||
setting -> new ModArmorItem(setting
|
||||
.armor(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, EquipmentType.BOOTS)
|
||||
.maxDamage(EquipmentType.BOOTS.getMaxDamage(15))));
|
||||
public static final Item PRISMA_SMITHING_TEMPLATE = ModItems.registerItem("prisma_armor_trim_smithing_template",
|
||||
SmithingTemplateItem::of);
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.consume.UseAction;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
@@ -73,7 +74,7 @@ public class BubblePipe extends Item {
|
||||
double vz = (world.random.nextDouble() - 0.5) * 0.01;
|
||||
|
||||
if (remainingUseTicks % 4 == 0) {
|
||||
world.addParticle(
|
||||
world.addParticleClient(
|
||||
ParticleTypes.BUBBLE_POP,
|
||||
x, y, z,
|
||||
vx, vy, vz
|
||||
|
||||
@@ -78,7 +78,7 @@ public class Cigarette extends Item {
|
||||
double vz = look.z * speed + (world.random.nextDouble() - 0.5) * 0.02;
|
||||
|
||||
if (remainingUseTicks % 4 == 0) {
|
||||
world.addParticle(
|
||||
world.addParticleClient(
|
||||
ParticleTypes.SMOKE,
|
||||
x, y, z,
|
||||
vx, vy, vz
|
||||
|
||||
@@ -112,7 +112,7 @@ public class CigaretteFunny extends Item {
|
||||
double vy = look.y * speed + (world.random.nextDouble() - 0.5) * 0.1;
|
||||
double vz = look.z * speed + (world.random.nextDouble() - 0.5) * 0.3;
|
||||
|
||||
world.addParticle(
|
||||
world.addParticleClient(
|
||||
ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
||||
x, y, z,
|
||||
vx, vy, vz
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CigaretteLemon extends Item {
|
||||
double vz = look.z * speed + (world.random.nextDouble() - 0.5) * 0.02;
|
||||
|
||||
if (remainingUseTicks % 4 == 0) {
|
||||
world.addParticle(
|
||||
world.addParticleClient(
|
||||
ParticleTypes.SMOKE,
|
||||
x, y, z,
|
||||
vx, vy, vz
|
||||
@@ -114,7 +114,7 @@ public class CigaretteLemon extends Item {
|
||||
double offsetY = (world.random.nextDouble() - 0.5) * 2 * 0.5f;
|
||||
double offsetZ = (world.random.nextDouble() - 0.5) * 2 * 0.5f;
|
||||
|
||||
world.addParticle(
|
||||
world.addParticleClient(
|
||||
ParticleTypes.EXPLOSION,
|
||||
eyePos.x + offsetX,
|
||||
eyePos.y + offsetY,
|
||||
|
||||
@@ -6,19 +6,24 @@ import com.acethewildfire.acesbs.screen.custom.CommandCoreScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.tooltip.TooltipType;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class CommandCore extends Item {
|
||||
public CommandCore(Settings settings) {
|
||||
@@ -51,25 +56,25 @@ public class CommandCore extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
} else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.command_core"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.command_core"));
|
||||
}
|
||||
|
||||
if(stack.get(ModDataComponentTypes.COMMAND) != null) {
|
||||
tooltip.add(Text.literal("Command: " + stack.get(ModDataComponentTypes.COMMAND)));
|
||||
textConsumer.accept(Text.literal("Command: " + stack.get(ModDataComponentTypes.COMMAND)));
|
||||
} else {
|
||||
tooltip.add(Text.literal("Command: None"));
|
||||
textConsumer.accept(Text.literal("Command: None"));
|
||||
}
|
||||
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||
super.inventoryTick(stack, world, entity, slot, selected);
|
||||
public void inventoryTick(ItemStack stack, ServerWorld world, Entity entity, @Nullable EquipmentSlot slot) {
|
||||
super.inventoryTick(stack, world, entity, slot);
|
||||
|
||||
String command = stack.get(ModDataComponentTypes.COMMAND);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.acethewildfire.acesbs.item.custom;
|
||||
|
||||
import net.minecraft.item.MiningToolItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
@@ -12,10 +12,10 @@ import net.minecraft.util.math.Direction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HammerItem extends MiningToolItem {
|
||||
public class HammerItem extends Item {
|
||||
|
||||
public HammerItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
|
||||
super(material, BlockTags.PICKAXE_MINEABLE, attackDamage, attackSpeed, settings);
|
||||
super(settings.pickaxe(material, attackDamage, attackSpeed));
|
||||
}
|
||||
|
||||
public static List<BlockPos> getBlocksToBeDestroyed(int range, BlockPos initalBlockPos, ServerPlayerEntity player) {
|
||||
|
||||
@@ -5,19 +5,22 @@ import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.component.type.EquippableComponent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ModArmorItem extends ArmorItem {
|
||||
public class ModArmorItem extends Item {
|
||||
private static final Map<ArmorMaterial, List<StatusEffectInstance>> MATERIAL_TO_EFFECT_MAP =
|
||||
(new ImmutableMap.Builder<ArmorMaterial, List<StatusEffectInstance>>())
|
||||
.put(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL,
|
||||
@@ -29,12 +32,14 @@ public class ModArmorItem extends ArmorItem {
|
||||
// new StatusEffectInstance(StatusEffects.JUMP_BOOST, 400, 1, false, false)))
|
||||
.build();
|
||||
|
||||
public ModArmorItem(ArmorMaterial material, EquipmentType type, Settings settings) {
|
||||
super(material, type, settings);
|
||||
public ModArmorItem(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||
public void inventoryTick(ItemStack stack, ServerWorld world, Entity entity, @Nullable EquipmentSlot slot) {
|
||||
super.inventoryTick(stack, world, entity, slot);
|
||||
|
||||
if(!world.isClient()) {
|
||||
if(entity instanceof PlayerEntity player) {
|
||||
if(hasFullSuitOfArmorOn(player)) {
|
||||
@@ -43,7 +48,7 @@ public class ModArmorItem extends ArmorItem {
|
||||
}
|
||||
}
|
||||
|
||||
super.inventoryTick(stack, world, entity, slot, selected);
|
||||
super.inventoryTick(stack, world, entity, slot);
|
||||
}
|
||||
|
||||
private void evaluateArmorEffects(PlayerEntity player) {
|
||||
@@ -69,30 +74,24 @@ public class ModArmorItem extends ArmorItem {
|
||||
}
|
||||
|
||||
private boolean hasFullSuitOfArmorOn(PlayerEntity player) {
|
||||
ItemStack boots = player.getInventory().getArmorStack(0);
|
||||
ItemStack leggings = player.getInventory().getArmorStack(1);
|
||||
ItemStack breastplate = player.getInventory().getArmorStack(2);
|
||||
ItemStack helmet = player.getInventory().getArmorStack(3);
|
||||
ItemStack boots = player.getInventory().getStack(EquipmentSlot.FEET.getIndex());
|
||||
ItemStack leggings = player.getInventory().getStack(EquipmentSlot.LEGS.getIndex());
|
||||
ItemStack chestplate = player.getInventory().getStack(EquipmentSlot.CHEST.getIndex());
|
||||
ItemStack helmet = player.getInventory().getStack(EquipmentSlot.HEAD.getIndex());
|
||||
|
||||
return !helmet.isEmpty() && !breastplate.isEmpty()
|
||||
return !helmet.isEmpty() && !chestplate.isEmpty()
|
||||
&& !leggings.isEmpty() && !boots.isEmpty();
|
||||
}
|
||||
|
||||
private boolean hasCorrectArmorOn(ArmorMaterial material, PlayerEntity player) {
|
||||
for (ItemStack armorStack: player.getInventory().armor) {
|
||||
if(!(armorStack.getItem() instanceof ArmorItem)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ArmorItem boots = ((ArmorItem)player.getInventory().getArmorStack(0).getItem());
|
||||
ArmorItem leggings = ((ArmorItem)player.getInventory().getArmorStack(1).getItem());
|
||||
ArmorItem breastplate = ((ArmorItem)player.getInventory().getArmorStack(2).getItem());
|
||||
ArmorItem helmet = ((ArmorItem)player.getInventory().getArmorStack(3).getItem());
|
||||
ItemStack boots = player.getInventory().getStack(EquipmentSlot.FEET.getIndex());
|
||||
ItemStack leggings = player.getInventory().getStack(EquipmentSlot.LEGS.getIndex());
|
||||
ItemStack chestplate = player.getInventory().getStack(EquipmentSlot.CHEST.getIndex());
|
||||
ItemStack helmet = player.getInventory().getStack(EquipmentSlot.HEAD.getIndex());
|
||||
|
||||
EquippableComponent equippableComponentBoots = boots.getComponents().get(DataComponentTypes.EQUIPPABLE);
|
||||
EquippableComponent equippableComponentLeggings = leggings.getComponents().get(DataComponentTypes.EQUIPPABLE);
|
||||
EquippableComponent equippableComponentBreastplate = breastplate.getComponents().get(DataComponentTypes.EQUIPPABLE);
|
||||
EquippableComponent equippableComponentBreastplate = chestplate.getComponents().get(DataComponentTypes.EQUIPPABLE);
|
||||
EquippableComponent equippableComponentHelmet = helmet.getComponents().get(DataComponentTypes.EQUIPPABLE);
|
||||
|
||||
return equippableComponentBoots.assetId().get().equals(material.assetId()) && equippableComponentLeggings.assetId().get().equals(material.assetId()) &&
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.acethewildfire.acesbs.item.custom;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnReason;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.projectile.thrown.PotionEntity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -22,13 +23,11 @@ public class OracleLemon extends SplashPotionItem {
|
||||
public ActionResult use(World world, PlayerEntity user, Hand hand) {
|
||||
ItemStack itemStack = user.getStackInHand(hand);
|
||||
if (world instanceof ServerWorld serverWorld) {
|
||||
PotionEntity potionEntity = new PotionEntity(EntityType.POTION, serverWorld);
|
||||
PotionEntity potionEntity = EntityType.SPLASH_POTION.create(serverWorld, SpawnReason.TRIGGERED);
|
||||
|
||||
potionEntity.setOwner(user);
|
||||
potionEntity.setItem(itemStack);
|
||||
potionEntity.setVelocity(user, user.getPitch(), user.getYaw(), 0F, 2.5F, 1.0F);
|
||||
|
||||
serverWorld.spawnEntity(potionEntity);
|
||||
}
|
||||
|
||||
user.incrementStat(Stats.USED.getOrCreateStat(this));
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.acethewildfire.acesbs.item.PrismaSteelItems;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
@@ -13,9 +13,9 @@ import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SovsPlateCarrierArmorItem extends ArmorItem {
|
||||
public SovsPlateCarrierArmorItem(ArmorMaterial material, EquipmentType type, Settings settings) {
|
||||
super(material, type, settings);
|
||||
public class SovsPlateCarrierArmorItem extends Item {
|
||||
public SovsPlateCarrierArmorItem(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.acethewildfire.acesbs.component.ModDataComponentTypes;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,6 +21,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Wand extends Item {
|
||||
private static final Map<Block, Block> WAND_MAP =
|
||||
@@ -56,17 +58,17 @@ public class Wand extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
|
||||
public void appendTooltip(ItemStack stack, TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type) {
|
||||
if(!Screen.hasShiftDown()){
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.generic.shift_up"));
|
||||
} else {
|
||||
tooltip.add(Text.translatable("tooltip.acesbs.wand"));
|
||||
textConsumer.accept(Text.translatable("tooltip.acesbs.wand"));
|
||||
}
|
||||
|
||||
if(stack.get(ModDataComponentTypes.COORDINATES) != null) {
|
||||
tooltip.add(Text.literal("Last Block Changed at " + stack.get(ModDataComponentTypes.COORDINATES)));
|
||||
textConsumer.accept(Text.literal("Last Block Changed at " + stack.get(ModDataComponentTypes.COORDINATES)));
|
||||
}
|
||||
|
||||
super.appendTooltip(stack, context, tooltip, type);
|
||||
super.appendTooltip(stack, context, displayComponent, textConsumer, type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ package com.acethewildfire.acesbs.item.custom;
|
||||
import com.acethewildfire.acesbs.item.ModItems;
|
||||
import com.acethewildfire.acesbs.particle.ModParticles;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
@@ -12,24 +13,26 @@ import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WildfireArmorItem extends ArmorItem {
|
||||
public class WildfireArmorItem extends Item {
|
||||
|
||||
int tick = 0;
|
||||
|
||||
public WildfireArmorItem(ArmorMaterial material, EquipmentType type, Settings settings) {
|
||||
super(material, type, settings);
|
||||
public WildfireArmorItem(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||
public void inventoryTick(ItemStack stack, ServerWorld world, Entity entity, @Nullable EquipmentSlot slot) {
|
||||
if(!world.isClient()) {
|
||||
if(entity instanceof PlayerEntity player) {
|
||||
ItemStack bootsStack = player.getInventory().getArmorStack(0);
|
||||
ItemStack bootsStack = player.getInventory().getStack(EquipmentSlot.FEET.getIndex());
|
||||
if (!bootsStack.isEmpty() && bootsStack.getItem() == ModItems.WILDFIRE_BOOTS){
|
||||
double x = player.getX();
|
||||
double y = player.getY(); // feet level
|
||||
@@ -107,6 +110,6 @@ public class WildfireArmorItem extends ArmorItem {
|
||||
}
|
||||
}
|
||||
|
||||
super.inventoryTick(stack, world, entity, slot, selected);
|
||||
super.inventoryTick(stack, world, entity, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ public class CreeperTickMixin {
|
||||
creeper.getPitch()
|
||||
);
|
||||
|
||||
newMob.prevYaw = creeper.prevYaw;
|
||||
newMob.prevPitch = creeper.prevPitch;
|
||||
newMob.lastYaw = creeper.lastYaw;
|
||||
newMob.lastPitch = creeper.lastPitch;
|
||||
|
||||
newMob.setBodyYaw(creeper.getBodyYaw());
|
||||
newMob.setHeadYaw(creeper.getHeadYaw());
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class LivingEntityMixin {
|
||||
@Inject(method = "takeKnockback", at = @At("HEAD"), cancellable = true)
|
||||
private void cancelKnockback(double strength, double x, double z, CallbackInfo ci) {
|
||||
if ((Object)this instanceof PlayerEntity player) {
|
||||
for (ItemStack stack : player.getInventory().main) {
|
||||
for (ItemStack stack : player.getInventory().getMainStacks()) {
|
||||
if (stack.isOf(ModItems.COMMAND_CORE)) {
|
||||
if (Boolean.TRUE.equals(stack.get(ModDataComponentTypes.COMMAND_ACTIVE))){
|
||||
if (Objects.equals(stack.get(ModDataComponentTypes.COMMAND), "Immovable")){
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class PlayerEntityMixin{
|
||||
|
||||
@Inject(method = "damage", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true)
|
||||
private void damageMixin(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
|
||||
Item chestplate = this.inventory.getArmorStack(2).getItem();
|
||||
Item chestplate = this.inventory.player.getInventory().getStack(EquipmentSlot.CHEST.getIndex()).getItem();
|
||||
if (chestplate == ModItems.BERSERKERS_PAULDRON && Objects.equals(this.getName().getLiteralString(), "Tennocraft12")){
|
||||
PlayerEntity player = (PlayerEntity) (Object) this;
|
||||
if (!world.isClient()) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class VillagerFireMixin {
|
||||
|
||||
VillagerEntity villager = (VillagerEntity)(Object)this;
|
||||
|
||||
if (villagerData.getProfession() == ModVillagers.BURNING_WIZARD) {
|
||||
if (villagerData.profession().value() == ModVillagers.BURNING_WIZARD) {
|
||||
NbtCompound nbt = new NbtCompound();
|
||||
villager.writeNbt(nbt);
|
||||
nbt.putBoolean("HasVisualFire", true);
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.acethewildfire.acesbs.AcesBS;
|
||||
import com.acethewildfire.acesbs.item.AshenSteelItems;
|
||||
import com.acethewildfire.acesbs.item.PrismaSteelItems;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.equipment.trim.ArmorTrimAssets;
|
||||
import net.minecraft.item.equipment.trim.ArmorTrimMaterial;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.Registries;
|
||||
@@ -35,7 +36,7 @@ public class ModTrimMaterials {
|
||||
|
||||
private static void register(Registerable<ArmorTrimMaterial> registerable, RegistryKey<ArmorTrimMaterial> armorTrimKey,
|
||||
RegistryEntry<Item> item, Style style) {
|
||||
ArmorTrimMaterial trimMaterial = new ArmorTrimMaterial(armorTrimKey.getValue().getPath(), item, Map.of(),
|
||||
ArmorTrimMaterial trimMaterial = new ArmorTrimMaterial(ArmorTrimAssets.of(armorTrimKey.getValue().getPath()),
|
||||
Text.translatable(Util.createTranslationKey("trim_material", armorTrimKey.getValue())).fillStyle(style));
|
||||
|
||||
registerable.register(armorTrimKey, trimMaterial);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ModTrimPatterns {
|
||||
}
|
||||
|
||||
private static void register(Registerable<ArmorTrimPattern> context, Item item, RegistryKey<ArmorTrimPattern> key) {
|
||||
ArmorTrimPattern trimPattern = new ArmorTrimPattern(key.getValue(), Registries.ITEM.getEntry(item),
|
||||
ArmorTrimPattern trimPattern = new ArmorTrimPattern(key.getValue(),
|
||||
Text.translatable(Util.createTranslationKey("trim_pattern", key.getValue())), false);
|
||||
|
||||
context.register(key, trimPattern);
|
||||
|
||||
@@ -102,8 +102,8 @@ public class ConversionManager {
|
||||
|
||||
v_bones.equipStack(EquipmentSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
|
||||
v_bones.prevYaw = skeleton.prevYaw;
|
||||
v_bones.prevPitch = skeleton.prevPitch;
|
||||
v_bones.lastYaw = skeleton.lastYaw;
|
||||
v_bones.lastPitch = skeleton.lastPitch;
|
||||
|
||||
v_bones.setBodyYaw(skeleton.getBodyYaw());
|
||||
v_bones.setHeadYaw(skeleton.getHeadYaw());
|
||||
|
||||
@@ -20,10 +20,11 @@ import net.minecraft.loot.function.ApplyBonusLootFunction;
|
||||
import net.minecraft.loot.function.ExplosionDecayLootFunction;
|
||||
import net.minecraft.loot.provider.number.UniformLootNumberProvider;
|
||||
import net.minecraft.predicate.NumberRange;
|
||||
import net.minecraft.predicate.component.ComponentPredicateTypes;
|
||||
import net.minecraft.predicate.component.ComponentsPredicate;
|
||||
import net.minecraft.predicate.item.EnchantmentPredicate;
|
||||
import net.minecraft.predicate.item.EnchantmentsPredicate;
|
||||
import net.minecraft.predicate.item.ItemPredicate;
|
||||
import net.minecraft.predicate.item.ItemSubPredicateTypes;
|
||||
import net.minecraft.registry.RegistryEntryLookup;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
@@ -93,12 +94,15 @@ public class UpdateRecipies {
|
||||
RegistryEntryLookup<Item> itemLookup = wrapperLookup.getOrThrow(RegistryKeys.ITEM);
|
||||
|
||||
LootCondition.Builder silkTouchCondition = MatchToolLootCondition.builder(
|
||||
ItemPredicate.Builder.create()
|
||||
.subPredicate(
|
||||
ItemSubPredicateTypes.ENCHANTMENTS,
|
||||
EnchantmentsPredicate.enchantments(List.of(new EnchantmentPredicate(impl.getOrThrow(Enchantments.SILK_TOUCH), NumberRange.IntRange.atLeast(1))))
|
||||
)
|
||||
);
|
||||
ItemPredicate.Builder.create().components(
|
||||
ComponentsPredicate.Builder.create()
|
||||
.partial(
|
||||
ComponentPredicateTypes.ENCHANTMENTS,
|
||||
EnchantmentsPredicate.enchantments(
|
||||
List.of(new EnchantmentPredicate(impl.getOrThrow(Enchantments.SILK_TOUCH), NumberRange.IntRange.atLeast(1)))))
|
||||
.build()
|
||||
)
|
||||
);
|
||||
|
||||
if (source.isBuiltin() && ores.contains(key)) {
|
||||
LootPool.Builder extraPool = LootPool.builder()
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
import net.minecraft.world.poi.PointOfInterestType;
|
||||
@@ -19,12 +20,14 @@ public class ModVillagers {
|
||||
public static final RegistryKey<PointOfInterestType> BURNING_POI_KEY = registerPoiKey("burning_poi");
|
||||
public static final PointOfInterestType BURNING_POI = registerPOI("burning_poi", ModBlocks.INFERNAL_ASHES_BLOCK);
|
||||
|
||||
public static final RegistryKey<VillagerProfession> BURNING_WIZARD_KEY =
|
||||
RegistryKey.of(RegistryKeys.VILLAGER_PROFESSION, Identifier.of(AcesBS.MOD_ID, "burning_wizard"));
|
||||
public static final VillagerProfession BURNING_WIZARD = registerProfession("burning_wizard", BURNING_POI_KEY);
|
||||
|
||||
|
||||
private static VillagerProfession registerProfession(String name, RegistryKey<PointOfInterestType> type) {
|
||||
return Registry.register(Registries.VILLAGER_PROFESSION, Identifier.of(AcesBS.MOD_ID, name),
|
||||
new VillagerProfession(name, entry -> entry.matchesKey(type), entry -> entry.matchesKey(type),
|
||||
new VillagerProfession(Text.of(name),entry -> entry.matchesKey(type), entry -> entry.matchesKey(type),
|
||||
ImmutableSet.of(), ImmutableSet.of(), SoundEvents.ENTITY_VILLAGER_WORK_LIBRARIAN));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.structure.rule.BlockMatchRuleTest;
|
||||
import net.minecraft.structure.rule.RuleTest;
|
||||
import net.minecraft.structure.rule.TagMatchRuleTest;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.DataPool;
|
||||
import net.minecraft.util.collection.Pool;
|
||||
import net.minecraft.util.math.intprovider.ConstantIntProvider;
|
||||
import net.minecraft.util.math.intprovider.IntProvider;
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||
@@ -64,7 +64,7 @@ public class ModConfiguredFeatures {
|
||||
|
||||
register(context, LEMONWOOD_KEY, Feature.TREE, new TreeFeatureConfig.Builder(
|
||||
BlockStateProvider.of(ModBlocks.LEMONWOOD_LOG),
|
||||
new CherryTrunkPlacer(7, 1, 0, new WeightedListIntProvider(new DataPool.Builder<IntProvider>().add(ConstantIntProvider.create(1), 1).add(ConstantIntProvider.create(2), 1).add(ConstantIntProvider.create(3), 1).build()), UniformIntProvider.create(2, 4), UniformIntProvider.create(-4, -3), UniformIntProvider.create(-1, 0)),
|
||||
new CherryTrunkPlacer(7, 1, 0, new WeightedListIntProvider(new Pool.Builder<IntProvider>().add(ConstantIntProvider.create(1), 1).add(ConstantIntProvider.create(2), 1).add(ConstantIntProvider.create(3), 1).build()), UniformIntProvider.create(2, 4), UniformIntProvider.create(-4, -3), UniformIntProvider.create(-1, 0)),
|
||||
|
||||
BlockStateProvider.of(ModBlocks.LEMONWOOD_LEAVES),
|
||||
new CherryFoliagePlacer(ConstantIntProvider.create(4), ConstantIntProvider.create(0), ConstantIntProvider.create(5), 0.25F, 0.5F, 0.16666667F, 0.33333334F),
|
||||
|
||||
Reference in New Issue
Block a user