diff --git a/gradle.properties b/gradle.properties index ab0b16e..fa5585a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 loader_version=0.18.3 # Mod Properties -mod_version=26.2.27 +mod_version=26.2.27.1 maven_group=dev.tggamesyt archives_base_name=szar # Dependencies diff --git a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java index 3991f6b..b19d50d 100644 --- a/src/client/java/dev/tggamesyt/szar/client/SzarClient.java +++ b/src/client/java/dev/tggamesyt/szar/client/SzarClient.java @@ -7,6 +7,7 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; +import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; @@ -18,12 +19,15 @@ import net.minecraft.client.option.KeyBinding; import net.minecraft.client.render.entity.FlyingItemEntityRenderer; import net.minecraft.client.render.entity.animation.Animation; import net.minecraft.client.render.entity.model.EntityModelLayer; +import net.minecraft.client.render.item.BuiltinModelItemRenderer; +import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.sound.EntityTrackingSoundInstance; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.sound.SoundInstance; import net.minecraft.client.sound.SoundManager; import net.minecraft.client.util.InputUtil; import net.minecraft.client.render.*; +import net.minecraft.client.util.ModelIdentifier; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; @@ -75,6 +79,13 @@ public class SzarClient implements ClientModInitializer { int loopStart = startOffset + startLength; @Override public void onInitializeClient() { + ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> { + ThirdpersonModelRegisterer.getAll().forEach((itemId, modelId) -> { + out.accept(new ModelIdentifier(modelId, "inventory")); + }); + }); + ThirdpersonModelRegisterer.register(new Identifier(MOD_ID, "weed_joint"), new Identifier(MOD_ID, "weed_joint_in_hand")); + ThirdpersonModelRegisterer.register(new Identifier(MOD_ID, "fasz"), new Identifier(MOD_ID, "fasz_in_hand")); ClientTickEvents.END_CLIENT_TICK.register(client -> { if (client.player == null) return; diff --git a/src/client/java/dev/tggamesyt/szar/client/ThirdpersonModelRegisterer.java b/src/client/java/dev/tggamesyt/szar/client/ThirdpersonModelRegisterer.java new file mode 100644 index 0000000..ff87d96 --- /dev/null +++ b/src/client/java/dev/tggamesyt/szar/client/ThirdpersonModelRegisterer.java @@ -0,0 +1,26 @@ +package dev.tggamesyt.szar.client; + +import net.minecraft.util.Identifier; +import net.minecraft.item.Item; +import net.minecraft.registry.Registries; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class ThirdpersonModelRegisterer { + // Maps base item ID -> custom in-hand model ID + private static final Map CUSTOM_MODELS = new HashMap<>(); + + public static void register(Identifier itemId, Identifier inHandModelId) { + CUSTOM_MODELS.put(itemId, inHandModelId); + } + + public static Identifier get(Item item) { + return CUSTOM_MODELS.get(Registries.ITEM.getId(item)); + } + + public static Map getAll() { + return Collections.unmodifiableMap(CUSTOM_MODELS); + } +} \ No newline at end of file diff --git a/src/client/java/dev/tggamesyt/szar/client/mixin/ItemRendererMixin.java b/src/client/java/dev/tggamesyt/szar/client/mixin/ItemRendererMixin.java new file mode 100644 index 0000000..44bac7b --- /dev/null +++ b/src/client/java/dev/tggamesyt/szar/client/mixin/ItemRendererMixin.java @@ -0,0 +1,55 @@ +package dev.tggamesyt.szar.client.mixin; + +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.item.ItemModels; +import net.minecraft.client.render.item.ItemRenderer; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.BakedModelManager; +import net.minecraft.client.render.model.json.ModelTransformationMode; +import net.minecraft.client.util.ModelIdentifier; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Identifier; +import net.minecraft.world.World; +import net.minecraft.entity.LivingEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.Redirect; + +import dev.tggamesyt.szar.client.ThirdpersonModelRegisterer; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(ItemRenderer.class) +public abstract class ItemRendererMixin { + + @ModifyVariable( + method = "renderItem(Lnet/minecraft/item/ItemStack;" + + "Lnet/minecraft/client/render/model/json/ModelTransformationMode;" + + "ZLnet/minecraft/client/util/math/MatrixStack;" + + "Lnet/minecraft/client/render/VertexConsumerProvider;" + + "IILnet/minecraft/client/render/model/BakedModel;)V", + at = @At("HEAD"), + argsOnly = true, + ordinal = 0 + ) + private BakedModel swapThirdPersonModel( + BakedModel originalModel, + ItemStack stack, + ModelTransformationMode renderMode + ) { + if (renderMode != ModelTransformationMode.GUI && renderMode != ModelTransformationMode.GROUND) { + + Identifier customId = ThirdpersonModelRegisterer.get(stack.getItem()); + if (customId != null) { + ModelIdentifier modelId = new ModelIdentifier(customId, "inventory"); + ItemRenderer self = (ItemRenderer)(Object)this; + return self.getModels().getModelManager().getModel(modelId); + } + } + + return originalModel; + } +} \ No newline at end of file diff --git a/src/client/resources/szar.client.mixins.json b/src/client/resources/szar.client.mixins.json index 5c5c0e9..59f88c0 100644 --- a/src/client/resources/szar.client.mixins.json +++ b/src/client/resources/szar.client.mixins.json @@ -4,13 +4,14 @@ "package": "dev.tggamesyt.szar.client.mixin", "compatibilityLevel": "JAVA_17", "client": [ + "ItemRendererMixin", "MouseMixin", - "RadiationHeartMixin", + "PlayerModelMixin", "RadiatedItemRendererMixin", + "RadiationHeartMixin", "SplashOverlayMixin", - "TGnameMixin", "TGcapeMixin", - "PlayerModelMixin" + "TGnameMixin" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/java/dev/tggamesyt/szar/IslamTerrorist.java b/src/main/java/dev/tggamesyt/szar/IslamTerrorist.java index 2ec00fd..08747c7 100644 --- a/src/main/java/dev/tggamesyt/szar/IslamTerrorist.java +++ b/src/main/java/dev/tggamesyt/szar/IslamTerrorist.java @@ -26,7 +26,7 @@ import java.util.*; public class IslamTerrorist extends PathAwareEntity implements Arrestable{ private BlockPos targetCoreBlock = null; // the core block this mob is attacking - private Vec3d taxiDirection; + private int airTicks = 0; private Vec3d currentDirection = null; // direction plane is moving private BlockPos taxiTarget; private int flyStraightTicks = 0; @@ -68,7 +68,11 @@ public class IslamTerrorist extends PathAwareEntity implements Arrestable{ Entity vehicle = this.getVehicle(); if (!(vehicle instanceof PlaneEntity plane) || targetCoreBlock == null) return; - + if (plane.isOnGround()) { + airTicks = 0; + } else { + airTicks++; + } Vec3d vel = plane.getVelocity(); // ------------------------- @@ -118,21 +122,38 @@ public class IslamTerrorist extends PathAwareEntity implements Arrestable{ } // ------------------------- - // HOMING PHASE + // HOMING PHASE (IMPROVED) // ------------------------- Vec3d target = Vec3d.ofCenter(targetCoreBlock); Vec3d toTarget = target.subtract(plane.getPos()); - Vec3d desired = toTarget.normalize().multiply(1.8); - // Add small upward lift if below target - if (plane.getY() < target.y - 10) { - desired = desired.add(0, 0.2, 0); + double distance = toTarget.length(); + Vec3d desiredDir = toTarget.normalize(); + + // Dynamic turning strength (increases over time) + double turnStrength = 0.03 + Math.min(airTicks * 0.002, 0.15); + // After ~60 ticks in air → much stronger turning + + // Stronger correction when close + if (distance < 25) { + turnStrength += 0.05; } - // Smooth turning toward target - currentDirection = currentDirection.lerp(desired.normalize(), 0.03).normalize(); + // Apply turning + currentDirection = currentDirection + .lerp(desiredDir, turnStrength) + .normalize(); - plane.setVelocity(currentDirection.multiply(1.8)); + // Slow slightly when near target to avoid orbiting + double speed = 1.8; + if (distance < 30) { + speed = 1.2; + } + if (distance < 15) { + speed = 0.9; + } + + plane.setVelocity(currentDirection.multiply(speed)); // Face movement Vec3d look = plane.getVelocity().normalize(); @@ -152,7 +173,7 @@ public class IslamTerrorist extends PathAwareEntity implements Arrestable{ plane.getX(), plane.getY(), plane.getZ(), - 7.0f, + 9.0f, World.ExplosionSourceType.TNT ); @@ -265,7 +286,7 @@ public class IslamTerrorist extends PathAwareEntity implements Arrestable{ PlaneEntity plane = new PlaneEntity(Szar.PLANE_ENTITY_TYPE, world); plane.refreshPositionAndAngles(getX(), getY(), getZ(), getYaw(), getPitch()); - + this.setInvisible(true); world.spawnEntity(plane); this.startRiding(plane, true); diff --git a/src/main/java/dev/tggamesyt/szar/PlaneEntity.java b/src/main/java/dev/tggamesyt/szar/PlaneEntity.java index 04c6fa2..1952a4b 100644 --- a/src/main/java/dev/tggamesyt/szar/PlaneEntity.java +++ b/src/main/java/dev/tggamesyt/szar/PlaneEntity.java @@ -8,12 +8,14 @@ import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.vehicle.BoatEntity; import net.minecraft.nbt.NbtCompound; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; +import net.minecraft.world.GameRules; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; @@ -21,6 +23,12 @@ public class PlaneEntity extends Entity { private static final TrackedData ENGINE_TARGET = DataTracker.registerData(PlaneEntity.class, TrackedDataHandlerRegistry.FLOAT); + private static final TrackedData DAMAGE_WOBBLE_TICKS = + DataTracker.registerData(PlaneEntity.class, TrackedDataHandlerRegistry.INTEGER); + private static final TrackedData DAMAGE_WOBBLE_STRENGTH = + DataTracker.registerData(PlaneEntity.class, TrackedDataHandlerRegistry.FLOAT); + private static final TrackedData DAMAGE_WOBBLE_SIDE = + DataTracker.registerData(PlaneEntity.class, TrackedDataHandlerRegistry.INTEGER); private PlaneAnimation currentServerAnimation = null; private float enginePower = 0f; private double lastY; @@ -46,6 +54,9 @@ public class PlaneEntity extends Entity { @Override protected void initDataTracker() { + this.dataTracker.startTracking(DAMAGE_WOBBLE_TICKS, 0); + this.dataTracker.startTracking(DAMAGE_WOBBLE_STRENGTH, 0f); + this.dataTracker.startTracking(DAMAGE_WOBBLE_SIDE, 1); this.dataTracker.startTracking(ENGINE_TARGET, 0f); } @Override @@ -182,7 +193,7 @@ public class PlaneEntity extends Entity { boolean crash = (horizontalImpact > 1.5 && horizontalCollision) || (verticalImpact > explodeSpeed && verticalCollision); if (crash) { - getWorld().createExplosion(this, getX(), getY(), getZ(), 7.0f, World.ExplosionSourceType.TNT); + getWorld().createExplosion(this, getX(), getY(), getZ(), 9.0f, World.ExplosionSourceType.TNT); remove(RemovalReason.KILLED); return; } @@ -271,5 +282,51 @@ public class PlaneEntity extends Entity { } return ActionResult.SUCCESS; } + public void setDamageWobbleTicks(int ticks) { + this.dataTracker.set(DAMAGE_WOBBLE_TICKS, ticks); + } + public int getDamageWobbleTicks() { + return this.dataTracker.get(DAMAGE_WOBBLE_TICKS); + } + + public void setDamageWobbleStrength(float strength) { + this.dataTracker.set(DAMAGE_WOBBLE_STRENGTH, strength); + } + + public float getDamageWobbleStrength() { + return this.dataTracker.get(DAMAGE_WOBBLE_STRENGTH); + } + + public void setDamageWobbleSide(int side) { + this.dataTracker.set(DAMAGE_WOBBLE_SIDE, side); + } + + public int getDamageWobbleSide() { + return this.dataTracker.get(DAMAGE_WOBBLE_SIDE); + } + + private void dropItemAsItem() { + this.dropItem(Szar.PLANE); + } + @Override + public boolean damage(DamageSource source, float amount) { + if (this.isInvulnerableTo(source)) return false; + if (this.getWorld().isClient) return true; + + // wobble effect + this.setDamageWobbleSide(-this.getDamageWobbleSide()); + this.setDamageWobbleTicks(10); + this.setDamageWobbleStrength(this.getDamageWobbleStrength() + amount * 10f); + + boolean isCreative = source.getAttacker() instanceof PlayerEntity player && player.getAbilities().creativeMode; + + if (isCreative || this.getDamageWobbleStrength() > 40f) { + if (!isCreative && this.getWorld().getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { + this.dropItemAsItem(); // drop plane item + } + this.remove(RemovalReason.KILLED); + } + return true; + } } diff --git a/src/main/java/dev/tggamesyt/szar/Szar.java b/src/main/java/dev/tggamesyt/szar/Szar.java index 26190c4..940f7e3 100644 --- a/src/main/java/dev/tggamesyt/szar/Szar.java +++ b/src/main/java/dev/tggamesyt/szar/Szar.java @@ -249,8 +249,13 @@ public class Szar implements ModInitializer { .displayName(Text.translatable("itemgroup.szar_group")) .icon(() -> new ItemStack(Szar.CIGANYBLOCK)) // icon item .entries((displayContext, entries) -> { + // drugs + entries.add(Szar.CANNABIS_ITEM); + entries.add(Szar.WEED_ITEM); + entries.add(Szar.WEED_JOINT_ITEM); + entries.add(Szar.CHEMICAL_WORKBENCH_ITEM); + // racism entries.add(Szar.CIGANYBLOCK); - entries.add(Szar.FASZITEM); entries.add(Szar.NWORD_PASS); entries.add(Szar.HITTER_SPAWNEGG); entries.add(Szar.NAZI_SPAWNEGG); @@ -260,9 +265,31 @@ public class Szar implements ModInitializer { entries.add(Szar.POLICE_SPAWNEGG); entries.add(Szar.KEY_ITEM); entries.add(Szar.HANDCUFF_ITEM); - entries.add(Szar.CANNABIS_ITEM); - entries.add(Szar.WEED_ITEM); - entries.add(Szar.WEED_JOINT_ITEM); + // crazy weponary + entries.add(Szar.AK_AMMO); + entries.add(Szar.AK47); + entries.add(Szar.ATOM_DETONATOR); + entries.add(Szar.URANIUM_ORE); + entries.add(Szar.URANIUM); + entries.add(Szar.URANIUM_ROD); + entries.add(Szar.ATOM_CORE); + entries.add(Szar.ATOM); + entries.add(Szar.WHEEL); + entries.add(Szar.PLANE); + // random ahh silly stuff + entries.add(Szar.POPTART); + entries.add(Szar.NYAN_SPAWNEGG); + entries.add(Szar.EPSTEIN_FILES); + entries.add(Szar.EPSTEIN_SPAWNEGG); + entries.add(Szar.BAITER_DISK); + entries.add(Szar.MERL_SPAWNEGG); + entries.add(Szar.EFN_DISK); + // nsfw + entries.add(Szar.FASZITEM); + entries.add(Szar.CNDM); + entries.add(Szar.LATEX); + entries.add(Szar.WHITE_LIQUID); + // niggerite shits at the end entries.add(Szar.NIGGERITE_INGOT); entries.add(Szar.NIGGERITE_SWORD); entries.add(Szar.NIGGERITE_AXE); @@ -274,25 +301,6 @@ public class Szar implements ModInitializer { entries.add(Szar.NIGGERITE_LEGGINGS); entries.add(Szar.NIGGERITE_BOOTS); entries.add(Szar.NIGGERITE_BLOCK); - entries.add(Szar.CHEMICAL_WORKBENCH_ITEM); - entries.add(Szar.AK_AMMO); - entries.add(Szar.AK47); - entries.add(Szar.POPTART); - entries.add(Szar.NYAN_SPAWNEGG); - entries.add(Szar.EPSTEIN_FILES); - entries.add(Szar.EPSTEIN_SPAWNEGG); - entries.add(Szar.ATOM_DETONATOR); - entries.add(Szar.URANIUM_ORE); - entries.add(Szar.URANIUM); - entries.add(Szar.URANIUM_ROD); - entries.add(Szar.ATOM_CORE); - entries.add(Szar.ATOM); - entries.add(Szar.BAITER_DISK); - entries.add(Szar.MERL_SPAWNEGG); - entries.add(Szar.EFN_DISK); - entries.add(Szar.CNDM); - entries.add(Szar.LATEX); - entries.add(Szar.WHITE_LIQUID); }) .build() ); @@ -724,6 +732,19 @@ public class Szar implements ModInitializer { new Identifier(MOD_ID, "latex"), new Item(new Item.Settings()) ); + public static final Item WHEEL = Registry.register( + Registries.ITEM, + new Identifier(MOD_ID, "wheel"), + new Item(new Item.Settings().food(new FoodComponent.Builder().alwaysEdible().hunger(1).build())) + ); + public static final Item PLANE = Registry.register( + Registries.ITEM, + new Identifier(MOD_ID, "plane"), + new SzarSpawnEgg( + PLANE_ENTITY_TYPE, + new Item.Settings() + ) + ); public static final StructurePieceType TNT_OBELISK_PIECE = Registry.register( Registries.STRUCTURE_PIECE, diff --git a/src/main/java/dev/tggamesyt/szar/SzarSpawnEgg.java b/src/main/java/dev/tggamesyt/szar/SzarSpawnEgg.java new file mode 100644 index 0000000..ed565f3 --- /dev/null +++ b/src/main/java/dev/tggamesyt/szar/SzarSpawnEgg.java @@ -0,0 +1,120 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// + +package dev.tggamesyt.szar; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.FluidBlock; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.MobSpawnerBlockEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.passive.PassiveEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.resource.featuretoggle.FeatureSet; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.stat.Stats; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.hit.HitResult.Type; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraft.world.RaycastContext.FluidHandling; +import net.minecraft.world.event.GameEvent; +import org.jetbrains.annotations.Nullable; + +public class SzarSpawnEgg extends Item { + private final EntityType type; + + public SzarSpawnEgg(EntityType type, Item.Settings settings) { + super(settings); + this.type = type; + } + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + if (!(world instanceof ServerWorld)) { + return ActionResult.SUCCESS; + } else { + ItemStack itemStack = context.getStack(); + BlockPos blockPos = context.getBlockPos(); + Direction direction = context.getSide(); + BlockState blockState = world.getBlockState(blockPos); + + BlockPos blockPos2; + if (blockState.getCollisionShape(world, blockPos).isEmpty()) { + blockPos2 = blockPos; + } else { + blockPos2 = blockPos.offset(direction); + } + + EntityType entityType2 = this.getEntityType(itemStack.getNbt()); + if (entityType2.spawnFromItemStack((ServerWorld)world, itemStack, context.getPlayer(), blockPos2, SpawnReason.SPAWN_EGG, true, !Objects.equals(blockPos, blockPos2) && direction == Direction.UP) != null) { + itemStack.decrement(1); + world.emitGameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, blockPos); + } + + return ActionResult.CONSUME; + } + } + @Override + public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + ItemStack itemStack = user.getStackInHand(hand); + BlockHitResult blockHitResult = raycast(world, user, FluidHandling.SOURCE_ONLY); + if (blockHitResult.getType() != Type.BLOCK) { + return TypedActionResult.pass(itemStack); + } else if (!(world instanceof ServerWorld)) { + return TypedActionResult.success(itemStack); + } else { + BlockPos blockPos = blockHitResult.getBlockPos(); + if (!(world.getBlockState(blockPos).getBlock() instanceof FluidBlock)) { + return TypedActionResult.pass(itemStack); + } else if (world.canPlayerModifyAt(user, blockPos) && user.canPlaceOn(blockPos, blockHitResult.getSide(), itemStack)) { + EntityType entityType = this.getEntityType(itemStack.getNbt()); + Entity entity = entityType.spawnFromItemStack((ServerWorld)world, itemStack, user, blockPos, SpawnReason.SPAWN_EGG, false, false); + if (entity == null) { + return TypedActionResult.pass(itemStack); + } else { + if (!user.getAbilities().creativeMode) { + itemStack.decrement(1); + } + + user.incrementStat(Stats.USED.getOrCreateStat(this)); + world.emitGameEvent(user, GameEvent.ENTITY_PLACE, entity.getPos()); + return TypedActionResult.consume(itemStack); + } + } else { + return TypedActionResult.fail(itemStack); + } + } + } + + public EntityType getEntityType(@Nullable NbtCompound nbt) { + if (nbt != null && nbt.contains("EntityTag", 10)) { + NbtCompound nbtCompound = nbt.getCompound("EntityTag"); + if (nbtCompound.contains("id", 8)) { + return EntityType.get(nbtCompound.getString("id")).orElse(this.type); + } + } + + return this.type; + } +} diff --git a/src/main/resources/assets/szar/lang/en_us.json b/src/main/resources/assets/szar/lang/en_us.json index 37b30c4..88c7add 100644 --- a/src/main/resources/assets/szar/lang/en_us.json +++ b/src/main/resources/assets/szar/lang/en_us.json @@ -77,5 +77,7 @@ "item.szar.cndm": "Condom", "item.szar.latex": "Latex", "death.attack.fck": "%1$s got fucked too hard by %2$s", - "item.szar.white_liquid": "..." + "item.szar.white_liquid": "...", + "item.szar.plane": "Plane", + "item.szar.wheel": "Wheel" } diff --git a/src/main/resources/assets/szar/models/item/fasz.json b/src/main/resources/assets/szar/models/item/fasz.json index ef79bb3..0a411c3 100644 --- a/src/main/resources/assets/szar/models/item/fasz.json +++ b/src/main/resources/assets/szar/models/item/fasz.json @@ -1,3 +1,6 @@ { - "parent": "szar:block/fasz" + "parent": "minecraft:item/generated", + "textures": { + "layer0": "szar:item/fasz" + } } diff --git a/src/main/resources/assets/szar/models/item/fasz_in_hand.json b/src/main/resources/assets/szar/models/item/fasz_in_hand.json new file mode 100644 index 0000000..ef79bb3 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/fasz_in_hand.json @@ -0,0 +1,3 @@ +{ + "parent": "szar:block/fasz" +} diff --git a/src/main/resources/assets/szar/models/item/plane.json b/src/main/resources/assets/szar/models/item/plane.json new file mode 100644 index 0000000..8b39627 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/plane.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "szar:item/plane" + } +} diff --git a/src/main/resources/assets/szar/models/item/weed_joint.json b/src/main/resources/assets/szar/models/item/weed_joint.json index 868199c..8392311 100644 --- a/src/main/resources/assets/szar/models/item/weed_joint.json +++ b/src/main/resources/assets/szar/models/item/weed_joint.json @@ -1,32 +1,6 @@ { - "format_version": "1.9.0", - "credit": "Made with Blockbench", + "parent": "minecraft:item/generated", "textures": { - "0": "szar:item/joint3d", - "particle": "szar:item/joint3d" - }, - "elements": [ - { - "from": [7, 0, 7], - "to": [9, 12, 9], - "rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 7]}, - "faces": { - "north": {"uv": [0, 0, 2, 12], "texture": "#0"}, - "east": {"uv": [2, 0, 4, 12], "texture": "#0"}, - "south": {"uv": [4, 0, 6, 12], "texture": "#0"}, - "west": {"uv": [6, 0, 8, 12], "texture": "#0"}, - "up": {"uv": [10, 2, 8, 0], "texture": "#0"}, - "down": {"uv": [10, 2, 8, 4], "texture": "#0"} - } - } - ], - "overrides": [ - { - "predicate": { - "using": 1 - }, - "model": "szar:item/weed_joint_held" - } - ], - "display": {} -} \ No newline at end of file + "layer0": "szar:item/weed_joint" + } +} diff --git a/src/main/resources/assets/szar/models/item/weed_joint_in_hand.json b/src/main/resources/assets/szar/models/item/weed_joint_in_hand.json new file mode 100644 index 0000000..4195561 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/weed_joint_in_hand.json @@ -0,0 +1,23 @@ +{ + "format_version": "1.9.0", + "credit": "Made with Blockbench", + "textures": { + "0": "szar:item/joint3d", + "particle": "szar:item/joint3d" + }, + "elements": [ + { + "from": [7, 0, 7], + "to": [9, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 7]}, + "faces": { + "north": {"uv": [0, 0, 2, 12], "texture": "#0"}, + "east": {"uv": [2, 0, 4, 12], "texture": "#0"}, + "south": {"uv": [4, 0, 6, 12], "texture": "#0"}, + "west": {"uv": [6, 0, 8, 12], "texture": "#0"}, + "up": {"uv": [10, 2, 8, 0], "texture": "#0"}, + "down": {"uv": [10, 2, 8, 4], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/szar/models/item/wheel.json b/src/main/resources/assets/szar/models/item/wheel.json new file mode 100644 index 0000000..19d4fe2 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/wheel.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "szar:item/wheel" + } +} diff --git a/src/main/resources/assets/szar/textures/entity/zombie_villager/profession/drog_dealer.png b/src/main/resources/assets/szar/textures/entity/zombie_villager/profession/drog_dealer.png new file mode 100644 index 0000000..adb5f29 Binary files /dev/null and b/src/main/resources/assets/szar/textures/entity/zombie_villager/profession/drog_dealer.png differ diff --git a/src/main/resources/assets/szar/textures/item/fasz.png b/src/main/resources/assets/szar/textures/item/fasz.png new file mode 100644 index 0000000..bc6f6e6 Binary files /dev/null and b/src/main/resources/assets/szar/textures/item/fasz.png differ diff --git a/src/main/resources/assets/szar/textures/item/plane.png b/src/main/resources/assets/szar/textures/item/plane.png new file mode 100644 index 0000000..1a4730b Binary files /dev/null and b/src/main/resources/assets/szar/textures/item/plane.png differ diff --git a/src/main/resources/assets/szar/textures/item/wheel.png b/src/main/resources/assets/szar/textures/item/wheel.png new file mode 100644 index 0000000..a0d1f7f Binary files /dev/null and b/src/main/resources/assets/szar/textures/item/wheel.png differ diff --git a/src/main/resources/data/szar/recipes/baiter.json b/src/main/resources/data/szar/recipes/baiter.json index 75c50e0..14c7955 100644 --- a/src/main/resources/data/szar/recipes/baiter.json +++ b/src/main/resources/data/szar/recipes/baiter.json @@ -5,11 +5,10 @@ "tag": "minecraft:music_discs" }, { - "item": "szar:epstein_files" + "item": "szar:fasz" } ], "result": { - "item": "szar:baiter", - "count": 1 + "item": "szar:baiter" } } \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/efn.json b/src/main/resources/data/szar/recipes/efn.json new file mode 100644 index 0000000..207a708 --- /dev/null +++ b/src/main/resources/data/szar/recipes/efn.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "minecraft:music_discs" + }, + { + "item": "szar:epstein_files" + } + ], + "result": { + "item": "szar:efn" + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/latex.json b/src/main/resources/data/szar/recipes/latex.json index 7d595e8..94b345d 100644 --- a/src/main/resources/data/szar/recipes/latex.json +++ b/src/main/resources/data/szar/recipes/latex.json @@ -6,15 +6,11 @@ "SSS" ], "key": { - "S": { - "item": "minecraft:sugar" - }, - "L": { - "item": "minecraft:slime_ball" - } + "S": { "item": "minecraft:sugar" }, + "L": { "item": "minecraft:slime_ball" } }, "result": { "item": "szar:latex", - "count": 1 + "count": 2 } -} +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/plane.json b/src/main/resources/data/szar/recipes/plane.json new file mode 100644 index 0000000..5546e4e --- /dev/null +++ b/src/main/resources/data/szar/recipes/plane.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "GBB", + "IFB", + "W W" + ], + "key": { + "G": { "item": "minecraft:glass" }, + "B": { "item": "minecraft:iron_block" }, + "I": { "item": "minecraft:iron_ingot" }, + "F": { "item": "minecraft:furnace" }, + "W": { "item": "szar:wheel" } + }, + "result": { + "item": "szar:plane", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/szar/recipes/wheel.json b/src/main/resources/data/szar/recipes/wheel.json new file mode 100644 index 0000000..9db836e --- /dev/null +++ b/src/main/resources/data/szar/recipes/wheel.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BLB", + "LBL", + "BLB" + ], + "key": { + "B": { "item": "minecraft:black_dye" }, + "L": { "item": "szar:latex" } + }, + "result": { + "item": "szar:wheel", + "count": 1 + } +} \ No newline at end of file