Compare commits
8 Commits
szar-26.4.
...
szar-26.4.
| Author | SHA1 | Date | |
|---|---|---|---|
| a316290c9a | |||
| a8769a844d | |||
| cf267a959d | |||
| 73a172c9bd | |||
| 98f01f61c4 | |||
| bcc90e5593 | |||
| b476d156dc | |||
| 6b355a1f47 |
10
capes.json
@@ -2,23 +2,23 @@
|
||||
"capes": [
|
||||
{
|
||||
"id": "tg",
|
||||
"texture": "https://raw.githubusercontent.com/tggamesyt/szar/main/src/main/resources/assets/szar/textures/etc/tg_cape.png"
|
||||
"texture": "https://gitea.tggamesyt.dev/tggamesyt/szar/raw/main/src/main/resources/assets/szar/textures/etc/tg_cape.png"
|
||||
},
|
||||
{
|
||||
"id": "gabri",
|
||||
"texture": "https://raw.githubusercontent.com/tggamesyt/szar/main/src/main/resources/assets/szar/textures/etc/gabri_cape.png"
|
||||
"texture": "https://gitea.tggamesyt.dev/tggamesyt/szar/raw/main/src/main/resources/assets/szar/textures/etc/gabri_cape.png"
|
||||
},
|
||||
{
|
||||
"id": "tg1",
|
||||
"texture": "https://raw.githubusercontent.com/tggamesyt/szar/main/src/main/resources/assets/szar/textures/etc/tg_cape1.png"
|
||||
"texture": "https://gitea.tggamesyt.dev/tggamesyt/szar/raw/main/src/main/resources/assets/szar/textures/etc/tg_cape1.png"
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"texture": "https://raw.githubusercontent.com/tggamesyt/szar/main/src/main/resources/assets/szar/textures/etc/testcape.png"
|
||||
"texture": "https://gitea.tggamesyt.dev/tggamesyt/szar/raw/main/src/main/resources/assets/szar/textures/etc/testcape.png"
|
||||
},
|
||||
{
|
||||
"id": "ciber",
|
||||
"texture": "https://raw.githubusercontent.com/tggamesyt/szar/main/src/main/resources/assets/szar/textures/etc/ciber_cape.png"
|
||||
"texture": "https://gitea.tggamesyt.dev/tggamesyt/szar/raw/main/src/main/resources/assets/szar/textures/etc/ciber_cape.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,10 +6,11 @@ minecraft_version=1.20.1
|
||||
yarn_mappings=1.20.1+build.10
|
||||
loader_version=0.18.3
|
||||
# Mod Properties
|
||||
mod_version=26.4.13
|
||||
mod_version=26.4.15
|
||||
maven_group=dev.tggamesyt
|
||||
archives_base_name=szar
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.92.6+1.20.1
|
||||
modmenu_version=7.2.2
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package dev.tggamesyt.szar.client;
|
||||
|
||||
import dev.tggamesyt.szar.MagyarEntity;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayers;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class MagyarEntityRenderer
|
||||
extends MobEntityRenderer<MagyarEntity, BipedEntityModel<MagyarEntity>> {
|
||||
|
||||
public MagyarEntityRenderer(EntityRendererFactory.Context context) {
|
||||
super(
|
||||
context,
|
||||
new BipedEntityModel<>(context.getPart(EntityModelLayers.PLAYER)),
|
||||
0.5F
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(MagyarEntity entity) {
|
||||
return new Identifier("szar", "textures/entity/magyar.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package dev.tggamesyt.szar.client;
|
||||
|
||||
import dev.tggamesyt.szar.OrbanEntity;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.MobEntityRenderer;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayers;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class OrbanEntityRenderer
|
||||
extends MobEntityRenderer<OrbanEntity, BipedEntityModel<OrbanEntity>> {
|
||||
|
||||
public OrbanEntityRenderer(EntityRendererFactory.Context context) {
|
||||
super(
|
||||
context,
|
||||
new BipedEntityModel<>(context.getPart(EntityModelLayers.PLAYER)),
|
||||
0.5F
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(OrbanEntity entity) {
|
||||
return new Identifier("szar", "textures/entity/orban.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package dev.tggamesyt.szar.client;
|
||||
|
||||
import dev.tggamesyt.szar.Szar;
|
||||
import dev.tggamesyt.szar.SuperBeaconBlockEntity;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class SuperBeaconBlockEntityRenderer implements BlockEntityRenderer<SuperBeaconBlockEntity> {
|
||||
|
||||
// Path: assets/szar/textures/entity/beacon_beam.png
|
||||
public static final Identifier BEAM_TEXTURE = new Identifier(Szar.MOD_ID, "textures/entity/beacon_beam.png");
|
||||
|
||||
private static boolean loggedOnce = false;
|
||||
|
||||
public SuperBeaconBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
|
||||
Szar.LOGGER.info("[Szar] SuperBeaconBlockEntityRenderer constructed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SuperBeaconBlockEntity be, float tickDelta, MatrixStack matrices,
|
||||
VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
||||
|
||||
if (!loggedOnce) {
|
||||
Szar.LOGGER.info("[Szar] render() called once. level={}", be.getBeaconLevel());
|
||||
loggedOnce = true;
|
||||
}
|
||||
|
||||
if (be.getBeaconLevel() <= 0) return;
|
||||
if (be.getWorld() == null) return;
|
||||
|
||||
long worldTime = be.getWorld().getTime();
|
||||
|
||||
// Vanilla beacon beam, 1.20.1 signature:
|
||||
// public static void renderBeam(MatrixStack, VertexConsumerProvider, Identifier,
|
||||
// float tickDelta, float heightScale, long worldTime, int yOffset, int maxY,
|
||||
// float[] color, float innerRadius, float outerRadius)
|
||||
BeaconBlockEntityRenderer.renderBeam(
|
||||
matrices,
|
||||
vertexConsumers,
|
||||
BEAM_TEXTURE,
|
||||
tickDelta,
|
||||
1.0f,
|
||||
worldTime,
|
||||
0,
|
||||
1024,
|
||||
new float[]{1.0f, 1.0f, 1.0f},
|
||||
0.2f,
|
||||
0.25f
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rendersOutsideBoundingBox(SuperBeaconBlockEntity blockEntity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderDistance() {
|
||||
return 256;
|
||||
}
|
||||
}
|
||||
113
src/client/java/dev/tggamesyt/szar/client/SuperBeaconScreen.java
Normal file
@@ -0,0 +1,113 @@
|
||||
package dev.tggamesyt.szar.client;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import dev.tggamesyt.szar.Szar;
|
||||
import dev.tggamesyt.szar.SuperBeaconBlockEntity;
|
||||
import dev.tggamesyt.szar.SuperBeaconScreenHandler;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class SuperBeaconScreen extends HandledScreen<SuperBeaconScreenHandler> {
|
||||
|
||||
private static final Identifier TEXTURE = new Identifier(Szar.MOD_ID, "textures/gui/super_beacon.png");
|
||||
|
||||
private static final int GUI_WIDTH = 176;
|
||||
private static final int GUI_HEIGHT = 222;
|
||||
|
||||
private final ButtonWidget[] activateButtons = new ButtonWidget[4];
|
||||
|
||||
public SuperBeaconScreen(SuperBeaconScreenHandler handler, PlayerInventory inventory, Text title) {
|
||||
super(handler, inventory, title);
|
||||
this.backgroundWidth = GUI_WIDTH;
|
||||
this.backgroundHeight = GUI_HEIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
this.titleX = (this.backgroundWidth - this.textRenderer.getWidth(this.title)) / 2;
|
||||
this.titleY = 5;
|
||||
this.playerInventoryTitleY = this.backgroundHeight - 94;
|
||||
|
||||
for (int row = 0; row < 4; row++) {
|
||||
final int r = row;
|
||||
int buttonX = this.x + 108;
|
||||
int buttonY = this.y + 14 + row * 28;
|
||||
|
||||
activateButtons[row] = ButtonWidget.builder(
|
||||
getButtonText(row),
|
||||
button -> onActivateClicked(r)
|
||||
).dimensions(buttonX, buttonY, 56, 20).build();
|
||||
|
||||
addDrawableChild(activateButtons[row]);
|
||||
}
|
||||
}
|
||||
|
||||
private Text getButtonText(int row) {
|
||||
int level = handler.getBeaconLevel();
|
||||
if (level < row + 1) return Text.literal("Locked");
|
||||
return handler.isRowActive(row) ? Text.literal("Deactivate") : Text.literal("Activate");
|
||||
}
|
||||
|
||||
private void onActivateClicked(int row) {
|
||||
Szar.LOGGER.info("[Szar][CLIENT] activate button clicked: row={}, pos={}", row, handler.getPos());
|
||||
PacketByteBuf buf = PacketByteBufs.create();
|
||||
buf.writeBlockPos(handler.getPos());
|
||||
buf.writeInt(row);
|
||||
ClientPlayNetworking.send(Szar.ACTIVATE_ROW_PACKET, buf);
|
||||
Szar.LOGGER.info("[Szar][CLIENT] packet sent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(context);
|
||||
super.render(context, mouseX, mouseY, delta);
|
||||
drawMouseoverTooltip(context, mouseX, mouseY);
|
||||
|
||||
// Live updates
|
||||
for (int row = 0; row < 4; row++) {
|
||||
int level = handler.getBeaconLevel();
|
||||
// Always clickable so we can debug — actual lock check is server-side
|
||||
activateButtons[row].active = (level >= row + 1);
|
||||
activateButtons[row].setMessage(getButtonText(row));
|
||||
}
|
||||
|
||||
// Indicators + timer
|
||||
for (int row = 0; row < 4; row++) {
|
||||
int indicatorX = this.x + 26;
|
||||
int indicatorY = this.y + 20 + row * 28;
|
||||
|
||||
int level = handler.getBeaconLevel();
|
||||
int color;
|
||||
if (level < row + 1) color = 0xFF555555;
|
||||
else if (handler.isRowActive(row)) color = 0xFF00FF00;
|
||||
else color = 0xFFFF0000;
|
||||
|
||||
context.fill(indicatorX, indicatorY, indicatorX + 12, indicatorY + 12, color);
|
||||
|
||||
if (handler.isRowActive(row)) {
|
||||
int timer = handler.getFuelTimer(row);
|
||||
int remainingTicks = SuperBeaconBlockEntity.FUEL_INTERVAL - timer;
|
||||
int remainingSec = Math.max(0, remainingTicks / 20);
|
||||
int min = remainingSec / 60;
|
||||
int sec = remainingSec % 60;
|
||||
String timeStr = String.format("%d:%02d", min, sec);
|
||||
context.drawText(this.textRenderer, timeStr,
|
||||
indicatorX - 2, indicatorY + 14, 0xFFFFFF, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
|
||||
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
context.drawTexture(TEXTURE, this.x, this.y, 0, 0, backgroundWidth, backgroundHeight, GUI_WIDTH, GUI_HEIGHT);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||
@@ -548,6 +549,14 @@ public class SzarClient implements ClientModInitializer {
|
||||
Szar.HitterEntityType,
|
||||
HitterEntityRenderer::new
|
||||
);
|
||||
EntityRendererRegistry.register(
|
||||
OrbanEntityType,
|
||||
OrbanEntityRenderer::new
|
||||
);
|
||||
EntityRendererRegistry.register(
|
||||
MagyarEntityType,
|
||||
MagyarEntityRenderer::new
|
||||
);
|
||||
EntityRendererRegistry.register(
|
||||
Szar.StalinEntityType,
|
||||
StalinEntityRenderer::new
|
||||
@@ -608,6 +617,10 @@ public class SzarClient implements ClientModInitializer {
|
||||
Szar.CANNABIS_BLOCK,
|
||||
RenderLayer.getCutout()
|
||||
);
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||
SUPER_BEACON_BLOCK,
|
||||
RenderLayer.getCutout()
|
||||
);
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||
CONNECT_FOUR_BLOCK,
|
||||
RenderLayer.getCutout()
|
||||
@@ -730,6 +743,8 @@ public class SzarClient implements ClientModInitializer {
|
||||
(dispatcher, registryAccess) -> PanoramaClientCommand.register(dispatcher)
|
||||
);
|
||||
}
|
||||
HandledScreens.register(Szar.SUPER_BEACON_SCREEN_HANDLER, SuperBeaconScreen::new);
|
||||
BlockEntityRendererFactories.register(Szar.SUPER_BEACON_BLOCK_ENTITY, SuperBeaconBlockEntityRenderer::new);
|
||||
}
|
||||
private boolean isDebugEnabled() {
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package dev.tggamesyt.szar.client;
|
||||
|
||||
import dev.tggamesyt.szar.ModItemTagProvider;
|
||||
import dev.tggamesyt.szar.ModPoiTagProvider;
|
||||
import dev.tggamesyt.szar.ModWorldGenerator;
|
||||
import dev.tggamesyt.szar.Szar;
|
||||
import dev.tggamesyt.szar.*;
|
||||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.registry.RegistryBuilder;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
|
||||
public class SzarDataGenerator implements DataGeneratorEntrypoint {
|
||||
|
||||
@@ -16,12 +14,17 @@ public class SzarDataGenerator implements DataGeneratorEntrypoint {
|
||||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
|
||||
pack.addProvider(ModPoiTagProvider::new);
|
||||
pack.addProvider(ModItemTagProvider::new);
|
||||
pack.addProvider(ModWorldGenerator::new);
|
||||
FabricTagProvider<Block> blockTags =
|
||||
pack.addProvider(ModBlockTagProvider::new);
|
||||
pack.addProvider((output, registries) ->
|
||||
new ModItemTagProvider(output, registries, blockTags));
|
||||
|
||||
}
|
||||
@Override
|
||||
public void buildRegistry(RegistryBuilder registryBuilder) {
|
||||
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, Szar.ModConfiguredFeatures::boostrap);
|
||||
registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, Szar.ModPlacedFeatures::boostrap);
|
||||
registryBuilder.addRegistry(RegistryKeys.BIOME, ModBiomes::bootstrap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// 1.20.1 2026-03-16T18:04:06.196888 szar/World Gen
|
||||
// 1.20.1 2026-04-13T18:11:43.5891441 szar/World Gen
|
||||
1d26b5da3b0a2ea6b23d456d1f0b82455a788ca1 data\szar\worldgen\configured_feature\uranium_ore.json
|
||||
32864170bdb41310f9ee5d06f5720dfdb3badb6d data\szar\worldgen\placed_feature\uranium_ore_placed.json
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// 1.20.1 2026-04-13T18:11:43.5911498 szar/Tags for minecraft:block
|
||||
@@ -1,2 +1,2 @@
|
||||
// 1.20.1 2026-03-16T18:04:06.197868 szar/Tags for minecraft:point_of_interest_type
|
||||
// 1.20.1 2026-04-13T18:11:43.5911498 szar/Tags for minecraft:point_of_interest_type
|
||||
eba137b51c50a7143a3668876f41adaa1447b1d1 data\minecraft\tags\point_of_interest_type\acquirable_job_site.json
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// 1.20.1 2026-03-16T18:04:06.196888 szar/Tags for minecraft:item
|
||||
8a0ecda725173a6312a3e5d3a4b621cdecac4eed data\minecraft\tags\items\music_discs.json
|
||||
// 1.20.1 2026-04-13T18:11:43.5901497 szar/Tags for minecraft:item
|
||||
edfcd4a53e9627b3d636880f560f9adfa0dc0cdc data\minecraft\tags\items\music_discs.json
|
||||
aa4e63a06745e574bbe80e94cc1b417460045562 data\minecraft\tags\items\beacon_base_blocks.json
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:iron_block",
|
||||
"minecraft:gold_block",
|
||||
"minecraft:diamond_block",
|
||||
"minecraft:emerald_block",
|
||||
"minecraft:netherite_block",
|
||||
"minecraft:lapis_block",
|
||||
"szar:niggerite_block",
|
||||
"szar:cigany"
|
||||
]
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"szar:efn",
|
||||
"szar:hello",
|
||||
"szar:erika",
|
||||
"szar:ussr"
|
||||
"szar:ussr",
|
||||
"szar:hun_disc"
|
||||
]
|
||||
}
|
||||
@@ -5,11 +5,11 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
|
||||
import net.minecraft.entity.mob.PathAwareEntity;
|
||||
|
||||
public class AttackEnemyTeamGoal extends ActiveTargetGoal<LivingEntity> {
|
||||
public class AttackEnemyHunGoal extends ActiveTargetGoal<LivingEntity> {
|
||||
|
||||
public AttackEnemyTeamGoal(PathAwareEntity mob, String myTeam) {
|
||||
public AttackEnemyHunGoal(PathAwareEntity mob, String myTeam) {
|
||||
super(mob, LivingEntity.class, true, target -> {
|
||||
if (target instanceof TeamMember other) {
|
||||
if (target instanceof HunPartie other) {
|
||||
return !other.getTeam().equals(myTeam);
|
||||
}
|
||||
return false;
|
||||
18
src/main/java/dev/tggamesyt/szar/AttackEnemyWarGoal.java
Normal file
@@ -0,0 +1,18 @@
|
||||
// AttackEnemyTeamGoal.java
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
|
||||
import net.minecraft.entity.mob.PathAwareEntity;
|
||||
|
||||
public class AttackEnemyWarGoal extends ActiveTargetGoal<LivingEntity> {
|
||||
|
||||
public AttackEnemyWarGoal(PathAwareEntity mob, String myTeam) {
|
||||
super(mob, LivingEntity.class, true, target -> {
|
||||
if (target instanceof WarParticipant other) {
|
||||
return !other.getTeam().equals(myTeam);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class CommunistEntity extends PathAwareEntity implements Arrestable, TeamMember {
|
||||
public class CommunistEntity extends PathAwareEntity implements Arrestable, WarParticipant {
|
||||
|
||||
public static boolean arrestable = false;
|
||||
@Nullable
|
||||
@@ -38,7 +38,7 @@ public class CommunistEntity extends PathAwareEntity implements Arrestable, Team
|
||||
this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
57
src/main/java/dev/tggamesyt/szar/EnderArmorMaterial.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.ArmorMaterial;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
|
||||
import static dev.tggamesyt.szar.Szar.MOD_ID;
|
||||
|
||||
public class EnderArmorMaterial implements ArmorMaterial {
|
||||
|
||||
public static final EnderArmorMaterial INSTANCE = new EnderArmorMaterial();
|
||||
|
||||
private static final int[] BASE_DURABILITY = {14, 17, 18, 12};
|
||||
private static final int[] PROTECTION = {4, 9, 11, 4};
|
||||
|
||||
@Override
|
||||
public int getDurability(ArmorItem.Type type) {
|
||||
return BASE_DURABILITY[type.getEquipmentSlot().getEntitySlotId()] * 42;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProtection(ArmorItem.Type type) {
|
||||
return PROTECTION[type.getEquipmentSlot().getEntitySlotId()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnchantability() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.ofItems(Szar.ENDER_INGOT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return MOD_ID + ":ender";
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getToughness() {
|
||||
return 4F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getKnockbackResistance() {
|
||||
return 0.2F;
|
||||
}
|
||||
}
|
||||
@@ -20,12 +20,11 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static dev.tggamesyt.szar.Szar.NaziEntityType;
|
||||
|
||||
public class HitterEntity extends PathAwareEntity implements Arrestable, TeamMember {
|
||||
public class HitterEntity extends PathAwareEntity implements Arrestable, WarParticipant {
|
||||
|
||||
public static boolean arrestable = true;
|
||||
|
||||
@@ -40,7 +39,7 @@ public class HitterEntity extends PathAwareEntity implements Arrestable, TeamMem
|
||||
this.goalSelector.add(3, new LookAroundGoal(this));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
5
src/main/java/dev/tggamesyt/szar/HunPartie.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface HunPartie {
|
||||
String getTeam();
|
||||
}
|
||||
56
src/main/java/dev/tggamesyt/szar/MagyarEntity.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ai.goal.MeleeAttackGoal;
|
||||
import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.mob.PathAwareEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MagyarEntity extends PathAwareEntity implements Arrestable, HunPartie {
|
||||
|
||||
public static boolean arrestable = false;
|
||||
|
||||
public MagyarEntity(EntityType<? extends PathAwareEntity> type, World world) {
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initGoals() {
|
||||
this.goalSelector.add(2, new FollowLeaderWanderGoal(this, 1.0D, 6.0F));
|
||||
this.goalSelector.add(3, new WanderAroundFarGoal(this, 0.8D));
|
||||
this.goalSelector.add(1, new MeleeAttackGoal(this, 1.0, true));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyHunGoal(this, "tisza"));
|
||||
}
|
||||
|
||||
|
||||
public static DefaultAttributeContainer.Builder createAttributes() {
|
||||
return MobEntity.createMobAttributes()
|
||||
.add(EntityAttributes.GENERIC_MAX_HEALTH, 20.0)
|
||||
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25)
|
||||
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropLoot(DamageSource source, boolean causedByPlayer) {
|
||||
var rand = this.getRandom();
|
||||
if (rand.nextFloat() < 0.01F) {
|
||||
this.dropItem(Szar.HUN_DISC);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArrestable() {
|
||||
return arrestable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTeam() {
|
||||
return "tisza";
|
||||
}
|
||||
}
|
||||
41
src/main/java/dev/tggamesyt/szar/ModBiomes.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.sound.BiomeMoodSound;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.GenerationSettings;
|
||||
import net.minecraft.world.biome.SpawnSettings;
|
||||
|
||||
public class ModBiomes {
|
||||
|
||||
public static void bootstrap(Registerable<Biome> context) {
|
||||
context.register(Szar.CHORUS_FOREST, createChorusForest());
|
||||
}
|
||||
|
||||
private static Biome createChorusForest() {
|
||||
return new Biome.Builder()
|
||||
.precipitation(false)
|
||||
.temperature(0.5f)
|
||||
.downfall(0.0f)
|
||||
|
||||
.effects(new BiomeEffects.Builder()
|
||||
.skyColor(0)
|
||||
.fogColor(10518688)
|
||||
.waterColor(4159204)
|
||||
.waterFogColor(329011)
|
||||
.moodSound(BiomeMoodSound.CAVE)
|
||||
.build())
|
||||
|
||||
.spawnSettings(new SpawnSettings.Builder()
|
||||
.creatureSpawnProbability(0.1f)
|
||||
.spawn(SpawnGroup.MONSTER,
|
||||
new SpawnSettings.SpawnEntry(net.minecraft.entity.EntityType.ENDERMAN, 10, 1, 4))
|
||||
.build())
|
||||
|
||||
.generationSettings(new GenerationSettings.Builder().build())
|
||||
|
||||
.build();
|
||||
}
|
||||
}
|
||||
21
src/main/java/dev/tggamesyt/szar/ModBlockTagProvider.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.registry.RegistryKeys;import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
||||
|
||||
public ModBlockTagProvider(FabricDataOutput output,
|
||||
CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup lookup) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,44 @@ package dev.tggamesyt.szar;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.registry.tag.ItemTags;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||
public ModItemTagProvider(FabricDataOutput output,
|
||||
CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
|
||||
super(output, completableFuture);
|
||||
CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture,
|
||||
FabricTagProvider<Block> blockTagProvider) {
|
||||
super(output, registriesFuture, (BlockTagProvider) blockTagProvider);
|
||||
}
|
||||
|
||||
public static final TagKey<Item> BEACON_BASE_BLOCKS =
|
||||
TagKey.of(RegistryKeys.ITEM, new Identifier("minecraft", "beacon_base_blocks"));
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup lookup) {
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.POPTART);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.BAITER_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.EFN_DISK);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.HELLO_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.ERIKA_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS).add(Szar.USSR_DISC);
|
||||
getOrCreateTagBuilder(ItemTags.MUSIC_DISCS)
|
||||
.add(Szar.POPTART)
|
||||
.add(Szar.BAITER_DISC)
|
||||
.add(Szar.EFN_DISK)
|
||||
.add(Szar.HELLO_DISC)
|
||||
.add(Szar.ERIKA_DISC)
|
||||
.add(Szar.USSR_DISC)
|
||||
.add(Szar.HUN_DISC);
|
||||
getOrCreateTagBuilder(BEACON_BASE_BLOCKS)
|
||||
.add(Items.IRON_BLOCK)
|
||||
.add(Items.GOLD_BLOCK)
|
||||
.add(Items.DIAMOND_BLOCK)
|
||||
.add(Items.EMERALD_BLOCK)
|
||||
.add(Items.NETHERITE_BLOCK)
|
||||
.add(Items.LAPIS_BLOCK)
|
||||
.add(Szar.NIGGERITE_BLOCK)
|
||||
.add(Szar.CIGANYBLOCK);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class NaziEntity extends PathAwareEntity implements Arrestable, TeamMember {
|
||||
public class NaziEntity extends PathAwareEntity implements Arrestable, WarParticipant {
|
||||
|
||||
private boolean hithandPlaying = false;
|
||||
private int hithandTimer = 0; // ticks remaining
|
||||
@@ -91,7 +91,7 @@ public class NaziEntity extends PathAwareEntity implements Arrestable, TeamMembe
|
||||
this.goalSelector.add(1, new AK47AttackGoal(this, 16.0F, 2));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "nazi"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "nazi"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
67
src/main/java/dev/tggamesyt/szar/OrbanEntity.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.EntityData;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnReason;
|
||||
import net.minecraft.entity.ai.goal.MeleeAttackGoal;
|
||||
import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.entity.mob.PathAwareEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.LocalDifficulty;
|
||||
import net.minecraft.world.ServerWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class OrbanEntity extends PathAwareEntity implements Arrestable, HunPartie {
|
||||
|
||||
public static boolean arrestable = false;
|
||||
|
||||
public OrbanEntity(EntityType<? extends PathAwareEntity> type, World world) {
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initGoals() {
|
||||
this.goalSelector.add(2, new FollowLeaderWanderGoal(this, 1.0D, 6.0F));
|
||||
this.goalSelector.add(3, new WanderAroundFarGoal(this, 0.8D));
|
||||
this.goalSelector.add(1, new MeleeAttackGoal(this, 1.0, true));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyHunGoal(this, "fidesz"));
|
||||
}
|
||||
|
||||
|
||||
public static DefaultAttributeContainer.Builder createAttributes() {
|
||||
return MobEntity.createMobAttributes()
|
||||
.add(EntityAttributes.GENERIC_MAX_HEALTH, 20.0)
|
||||
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25)
|
||||
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropLoot(DamageSource source, boolean causedByPlayer) {
|
||||
var rand = this.getRandom();
|
||||
if (rand.nextFloat() < 0.01F) {
|
||||
this.dropItem(Szar.HUN_DISC);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArrestable() {
|
||||
return arrestable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTeam() {
|
||||
return "fidesz";
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
|
||||
import static dev.tggamesyt.szar.Szar.CommunistEntityType;
|
||||
|
||||
public class StalinEntity extends PathAwareEntity implements Arrestable, TeamMember {
|
||||
public class StalinEntity extends PathAwareEntity implements Arrestable, WarParticipant {
|
||||
|
||||
public static boolean arrestable = true;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class StalinEntity extends PathAwareEntity implements Arrestable, TeamMem
|
||||
this.goalSelector.add(3, new LookAroundGoal(this));
|
||||
|
||||
this.targetSelector.add(1, new AggroOnHitRevengeGoal(this));
|
||||
this.targetSelector.add(2, new AttackEnemyTeamGoal(this, "communist"));
|
||||
this.targetSelector.add(2, new AttackEnemyWarGoal(this, "communist"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
50
src/main/java/dev/tggamesyt/szar/SuperBeaconBlock.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ItemScatterer;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SuperBeaconBlock extends BlockWithEntity implements BlockEntityProvider {
|
||||
|
||||
public SuperBeaconBlock(Settings settings) { super(settings); }
|
||||
|
||||
@Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; }
|
||||
|
||||
@Nullable @Override
|
||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||
return new SuperBeaconBlockEntity(pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
if (!world.isClient()) {
|
||||
NamedScreenHandlerFactory factory = state.createScreenHandlerFactory(world, pos);
|
||||
if (factory != null) player.openHandledScreen(factory);
|
||||
}
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
if (!state.isOf(newState.getBlock())) {
|
||||
BlockEntity be = world.getBlockEntity(pos);
|
||||
if (be instanceof SuperBeaconBlockEntity sbe) ItemScatterer.spawn(world, pos, sbe);
|
||||
super.onStateReplaced(state, world, pos, newState, moved);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable @Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
|
||||
return checkType(type, Szar.SUPER_BEACON_BLOCK_ENTITY, SuperBeaconBlockEntity::tick);
|
||||
}
|
||||
}
|
||||
383
src/main/java/dev/tggamesyt/szar/SuperBeaconBlockEntity.java
Normal file
@@ -0,0 +1,383 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Inventories;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.potion.PotionUtil;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.screen.PropertyDelegate;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SuperBeaconBlockEntity extends BlockEntity implements Inventory, ExtendedScreenHandlerFactory {
|
||||
|
||||
public static final int FUEL_INTERVAL = 27000;
|
||||
|
||||
private static final Set<StatusEffect> PERSISTENT_EFFECTS = new HashSet<>();
|
||||
static {
|
||||
PERSISTENT_EFFECTS.add(StatusEffects.NAUSEA);
|
||||
PERSISTENT_EFFECTS.add(StatusEffects.HEALTH_BOOST);
|
||||
}
|
||||
|
||||
private final DefaultedList<ItemStack> inventory = DefaultedList.ofSize(8, ItemStack.EMPTY);
|
||||
private final boolean[] rowActive = new boolean[4];
|
||||
private final int[] fuelTimers = new int[4];
|
||||
private int beaconLevel = 0;
|
||||
|
||||
// 4 unlock thresholds. Row N unlocks at level >= N+1.
|
||||
// After lvl >= 4 every additional layer just expands range.
|
||||
// Range formula: 2^(level + 5), capped at level 4 = 512 for unlock check, but range keeps growing.
|
||||
|
||||
private final Map<UUID, Map<Integer, Set<StatusEffect>>> persistentTracking = new HashMap<>();
|
||||
|
||||
private final PropertyDelegate propertyDelegate = new PropertyDelegate() {
|
||||
@Override public int get(int i) {
|
||||
return switch (i) {
|
||||
case 0 -> beaconLevel;
|
||||
case 1, 2, 3, 4 -> rowActive[i - 1] ? 1 : 0;
|
||||
case 5, 6, 7, 8 -> fuelTimers[i - 5];
|
||||
default -> 0;
|
||||
};
|
||||
}
|
||||
@Override public void set(int i, int v) {
|
||||
switch (i) {
|
||||
case 0 -> beaconLevel = v;
|
||||
case 1, 2, 3, 4 -> rowActive[i - 1] = v != 0;
|
||||
case 5, 6, 7, 8 -> fuelTimers[i - 5] = v;
|
||||
}
|
||||
}
|
||||
@Override public int size() { return 9; }
|
||||
};
|
||||
|
||||
public PropertyDelegate getPropertyDelegate() { return propertyDelegate; }
|
||||
|
||||
public SuperBeaconBlockEntity(BlockPos pos, BlockState state) {
|
||||
super(Szar.SUPER_BEACON_BLOCK_ENTITY, pos, state);
|
||||
}
|
||||
|
||||
// No level cap - check from 1 up to limit (until invalid layer found)
|
||||
public int computeBeaconLevel() {
|
||||
if (world == null) return 0;
|
||||
int levels = 0;
|
||||
// Hard upper cap of 320 just to prevent infinite loops; world height ~384 max
|
||||
for (int layer = 1; layer <= 320; layer++) {
|
||||
int y = pos.getY() - layer;
|
||||
// Stop if outside world
|
||||
if (y < world.getBottomY()) break;
|
||||
|
||||
boolean valid = true;
|
||||
for (int x = -layer; x <= layer && valid; x++) {
|
||||
for (int z = -layer; z <= layer; z++) {
|
||||
BlockState bs = world.getBlockState(new BlockPos(pos.getX() + x, y, pos.getZ() + z));
|
||||
if (!bs.isIn(BlockTags.BEACON_BASE_BLOCKS)) { valid = false; break; }
|
||||
}
|
||||
}
|
||||
if (valid) levels = layer; else break;
|
||||
}
|
||||
return levels;
|
||||
}
|
||||
|
||||
public int getBeaconLevel() { return beaconLevel; }
|
||||
public boolean isRowActive(int row) { return row >= 0 && row < 4 && rowActive[row]; }
|
||||
public int getFuelTimer(int row) { return row >= 0 && row < 4 ? fuelTimers[row] : 0; }
|
||||
|
||||
// 2^(level+5): lvl1=64, lvl2=128, lvl3=256, lvl4=512, lvl5=1024 ... no cap
|
||||
public double getEffectRadius() {
|
||||
if (beaconLevel <= 0) return 0.0;
|
||||
// Use long math then cast to double to avoid int overflow at high levels
|
||||
return (double)(1L << (beaconLevel + 5));
|
||||
}
|
||||
|
||||
public static void tick(World world, BlockPos pos, BlockState state, SuperBeaconBlockEntity be) {
|
||||
if (world.isClient()) return;
|
||||
|
||||
if (world.getTime() % 20 == 0) {
|
||||
int newLevel = be.computeBeaconLevel();
|
||||
if (newLevel != be.beaconLevel) {
|
||||
be.beaconLevel = newLevel;
|
||||
be.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
for (int row = 0; row < 4; row++) {
|
||||
if (!be.rowActive[row]) continue;
|
||||
|
||||
// Row N requires level >= N+1
|
||||
if (be.beaconLevel < row + 1 || be.getStack(row * 2).isEmpty()) {
|
||||
be.deactivateRow(row);
|
||||
continue;
|
||||
}
|
||||
|
||||
be.fuelTimers[row]++;
|
||||
if (be.fuelTimers[row] >= FUEL_INTERVAL) {
|
||||
ItemStack fuelItem = be.getStack(row * 2 + 1);
|
||||
if (fuelItem.isEmpty()) { be.deactivateRow(row); continue; }
|
||||
fuelItem.decrement(1);
|
||||
be.fuelTimers[row] = 0;
|
||||
if (fuelItem.isEmpty()) be.setStack(row * 2 + 1, ItemStack.EMPTY);
|
||||
be.markDirty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (world.getTime() % 80 == 0) be.applyAllEffects();
|
||||
if (world.getTime() % 100 == 0) be.checkPersistentRangeAll();
|
||||
if (world.getTime() % 100 == 0) be.cleanupPersistentTracking();
|
||||
}
|
||||
|
||||
// Collects effects from all active rows, summing amplifiers when same effect appears
|
||||
// in multiple rows. Stacking: lvl1 + lvl1 = lvl2 → amp_sum = amp1 + amp2 + 1.
|
||||
private Map<StatusEffect, Integer> collectCombinedEffects() {
|
||||
Map<StatusEffect, Integer> combined = new HashMap<>();
|
||||
for (int row = 0; row < 4; row++) {
|
||||
if (!rowActive[row]) continue;
|
||||
ItemStack effectItem = getStack(row * 2);
|
||||
List<StatusEffectInstance> effects = getEffectsFromItem(effectItem);
|
||||
for (StatusEffectInstance e : effects) {
|
||||
StatusEffect type = e.getEffectType();
|
||||
int amp = e.getAmplifier();
|
||||
if (combined.containsKey(type)) {
|
||||
// Stack: each row contributes (amp+1) levels
|
||||
combined.put(type, combined.get(type) + amp + 1);
|
||||
} else {
|
||||
combined.put(type, amp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return combined;
|
||||
}
|
||||
|
||||
private void applyAllEffects() {
|
||||
if (world == null) return;
|
||||
Map<StatusEffect, Integer> combined = collectCombinedEffects();
|
||||
if (combined.isEmpty()) return;
|
||||
|
||||
double radius = getEffectRadius();
|
||||
Box box = new Box(pos).expand(radius);
|
||||
List<PlayerEntity> players = world.getEntitiesByClass(PlayerEntity.class, box, p -> true);
|
||||
|
||||
for (PlayerEntity player : players) {
|
||||
for (Map.Entry<StatusEffect, Integer> e : combined.entrySet()) {
|
||||
StatusEffect type = e.getKey();
|
||||
int amp = Math.min(e.getValue(), 255); // amp cap
|
||||
|
||||
if (PERSISTENT_EFFECTS.contains(type)) {
|
||||
applyPersistent(player, type, amp);
|
||||
} else {
|
||||
player.addStatusEffect(new StatusEffectInstance(
|
||||
type, 120, amp, true, true, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Persistent tracking: key by effect type, store current applied amplifier
|
||||
// so we re-apply when amplifier changes (row added/removed)
|
||||
private void applyPersistent(PlayerEntity player, StatusEffect type, int amp) {
|
||||
UUID uuid = player.getUuid();
|
||||
Map<Integer, Set<StatusEffect>> bucket = persistentTracking.computeIfAbsent(uuid, k -> new HashMap<>());
|
||||
// Use single bucket key 0 to track all persistent effects per player
|
||||
Set<StatusEffect> tracked = bucket.computeIfAbsent(0, k -> new HashSet<>());
|
||||
|
||||
StatusEffectInstance current = player.getStatusEffect(type);
|
||||
if (current == null || current.getAmplifier() != amp) {
|
||||
player.removeStatusEffect(type);
|
||||
player.addStatusEffect(new StatusEffectInstance(
|
||||
type, Integer.MAX_VALUE, amp, true, true, true));
|
||||
tracked.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkPersistentRangeAll() {
|
||||
if (world == null) return;
|
||||
double radius = getEffectRadius();
|
||||
Vec3d center = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
Map<StatusEffect, Integer> combined = collectCombinedEffects();
|
||||
|
||||
for (Map.Entry<UUID, Map<Integer, Set<StatusEffect>>> entry : persistentTracking.entrySet()) {
|
||||
Set<StatusEffect> tracked = entry.getValue().get(0);
|
||||
if (tracked == null || tracked.isEmpty()) continue;
|
||||
|
||||
PlayerEntity player = world.getPlayerByUuid(entry.getKey());
|
||||
if (player == null) continue;
|
||||
|
||||
boolean outOfRange = player.getPos().distanceTo(center) > radius;
|
||||
|
||||
// Remove effects that are out of range OR no longer provided by any active row
|
||||
Iterator<StatusEffect> it = tracked.iterator();
|
||||
while (it.hasNext()) {
|
||||
StatusEffect e = it.next();
|
||||
if (outOfRange || !combined.containsKey(e)) {
|
||||
player.removeStatusEffect(e);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanupPersistentTracking() {
|
||||
persistentTracking.entrySet().removeIf(entry -> {
|
||||
entry.getValue().entrySet().removeIf(e -> e.getValue().isEmpty());
|
||||
return entry.getValue().isEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
private void removePersistentForRow(int row) {
|
||||
// Recompute combined effects (without this row, since it's already deactivated by caller)
|
||||
// and remove any tracked effects no longer provided.
|
||||
if (world == null) return;
|
||||
Map<StatusEffect, Integer> combined = collectCombinedEffects();
|
||||
|
||||
for (Map.Entry<UUID, Map<Integer, Set<StatusEffect>>> entry : persistentTracking.entrySet()) {
|
||||
Set<StatusEffect> tracked = entry.getValue().get(0);
|
||||
if (tracked == null) continue;
|
||||
PlayerEntity player = world.getPlayerByUuid(entry.getKey());
|
||||
if (player == null) { tracked.clear(); continue; }
|
||||
|
||||
Iterator<StatusEffect> it = tracked.iterator();
|
||||
while (it.hasNext()) {
|
||||
StatusEffect e = it.next();
|
||||
if (!combined.containsKey(e)) {
|
||||
player.removeStatusEffect(e);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<StatusEffectInstance> getEffectsFromItem(ItemStack stack) {
|
||||
List<StatusEffectInstance> potionEffects = PotionUtil.getPotionEffects(stack);
|
||||
if (!potionEffects.isEmpty()) return potionEffects;
|
||||
if (stack.getItem().getFoodComponent() != null) {
|
||||
return stack.getItem().getFoodComponent().getStatusEffects().stream()
|
||||
.map(pair -> pair.getFirst()).toList();
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
public static boolean isValidFuel(ItemStack stack) {
|
||||
return stack.isOf(Items.IRON_INGOT) || stack.isOf(Items.GOLD_INGOT) ||
|
||||
stack.isOf(Items.DIAMOND) || stack.isOf(Items.EMERALD) ||
|
||||
stack.isOf(Items.NETHERITE_INGOT);
|
||||
}
|
||||
|
||||
public static boolean isValidEffectItem(ItemStack stack) {
|
||||
if (!PotionUtil.getPotionEffects(stack).isEmpty()) return true;
|
||||
if (stack.getItem().getFoodComponent() != null) {
|
||||
return !stack.getItem().getFoodComponent().getStatusEffects().isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void toggleRow(int row) {
|
||||
Szar.LOGGER.info("[Szar] toggleRow called: row={}, level={}, active={}", row, beaconLevel, rowActive[row]);
|
||||
if (row < 0 || row >= 4) { Szar.LOGGER.warn("[Szar] row out of bounds"); return; }
|
||||
if (beaconLevel < row + 1) { Szar.LOGGER.warn("[Szar] row locked, need level {}", row + 1); return; }
|
||||
|
||||
if (rowActive[row]) {
|
||||
deactivateRow(row);
|
||||
Szar.LOGGER.info("[Szar] deactivated row {}", row);
|
||||
} else {
|
||||
ItemStack effectItem = getStack(row * 2);
|
||||
ItemStack fuelItem = getStack(row * 2 + 1);
|
||||
if (effectItem.isEmpty()) { Szar.LOGGER.warn("[Szar] effect slot empty"); return; }
|
||||
if (fuelItem.isEmpty()) { Szar.LOGGER.warn("[Szar] fuel slot empty"); return; }
|
||||
if (!isValidEffectItem(effectItem)) { Szar.LOGGER.warn("[Szar] effect item invalid: {}", effectItem); return; }
|
||||
if (!isValidFuel(fuelItem)) { Szar.LOGGER.warn("[Szar] fuel item invalid: {}", fuelItem); return; }
|
||||
|
||||
fuelItem.decrement(1);
|
||||
if (fuelItem.isEmpty()) setStack(row * 2 + 1, ItemStack.EMPTY);
|
||||
rowActive[row] = true;
|
||||
fuelTimers[row] = 0;
|
||||
markDirty();
|
||||
Szar.LOGGER.info("[Szar] activated row {}", row);
|
||||
}
|
||||
}
|
||||
|
||||
private void deactivateRow(int row) {
|
||||
rowActive[row] = false;
|
||||
fuelTimers[row] = 0;
|
||||
removePersistentForRow(row);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override public int size() { return 8; }
|
||||
@Override public boolean isEmpty() { return inventory.stream().allMatch(ItemStack::isEmpty); }
|
||||
@Override public ItemStack getStack(int slot) { return inventory.get(slot); }
|
||||
@Override public ItemStack removeStack(int slot, int amount) {
|
||||
ItemStack r = Inventories.splitStack(inventory, slot, amount); markDirty(); return r;
|
||||
}
|
||||
@Override public ItemStack removeStack(int slot) { return Inventories.removeStack(inventory, slot); }
|
||||
@Override public void setStack(int slot, ItemStack stack) {
|
||||
inventory.set(slot, stack);
|
||||
if (stack.getCount() > getMaxCountPerStack()) stack.setCount(getMaxCountPerStack());
|
||||
markDirty();
|
||||
}
|
||||
@Override public boolean canPlayerUse(PlayerEntity player) {
|
||||
return player.squaredDistanceTo(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5) <= 64.0;
|
||||
}
|
||||
@Override public void clear() { inventory.clear(); }
|
||||
|
||||
@Override public boolean isValid(int slot, ItemStack stack) {
|
||||
if (slot % 2 == 0) return isValidEffectItem(stack);
|
||||
return isValidFuel(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNbt(NbtCompound nbt) {
|
||||
super.writeNbt(nbt);
|
||||
Inventories.writeNbt(nbt, inventory);
|
||||
nbt.putIntArray("FuelTimers", fuelTimers);
|
||||
byte[] a = new byte[4];
|
||||
for (int i = 0; i < 4; i++) a[i] = (byte) (rowActive[i] ? 1 : 0);
|
||||
nbt.putByteArray("RowActive", a);
|
||||
nbt.putInt("BeaconLevel", beaconLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNbt(NbtCompound nbt) {
|
||||
super.readNbt(nbt);
|
||||
inventory.clear();
|
||||
Inventories.readNbt(nbt, inventory);
|
||||
if (nbt.contains("FuelTimers")) {
|
||||
int[] t = nbt.getIntArray("FuelTimers");
|
||||
System.arraycopy(t, 0, fuelTimers, 0, Math.min(t.length, 4));
|
||||
}
|
||||
if (nbt.contains("RowActive")) {
|
||||
byte[] a = nbt.getByteArray("RowActive");
|
||||
for (int i = 0; i < Math.min(a.length, 4); i++) rowActive[i] = a[i] != 0;
|
||||
}
|
||||
beaconLevel = nbt.getInt("BeaconLevel");
|
||||
}
|
||||
|
||||
@Override public Text getDisplayName() { return Text.translatable("block.szar.super_beacon"); }
|
||||
|
||||
@Override
|
||||
public ScreenHandler createMenu(int syncId, PlayerInventory inv, PlayerEntity player) {
|
||||
return new SuperBeaconScreenHandler(syncId, inv, this, propertyDelegate, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeScreenOpeningData(ServerPlayerEntity player, PacketByteBuf buf) {
|
||||
buf.writeBlockPos(pos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.SimpleInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.screen.ArrayPropertyDelegate;
|
||||
import net.minecraft.screen.PropertyDelegate;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class SuperBeaconScreenHandler extends ScreenHandler {
|
||||
|
||||
private final Inventory inventory;
|
||||
private final PropertyDelegate propertyDelegate;
|
||||
private final BlockPos pos;
|
||||
|
||||
// Client ctor
|
||||
public SuperBeaconScreenHandler(int syncId, PlayerInventory playerInventory, PacketByteBuf buf) {
|
||||
this(syncId, playerInventory, new SimpleInventory(8),
|
||||
new ArrayPropertyDelegate(9), buf.readBlockPos());
|
||||
}
|
||||
|
||||
// Server ctor
|
||||
public SuperBeaconScreenHandler(int syncId, PlayerInventory playerInventory, Inventory inventory,
|
||||
PropertyDelegate propertyDelegate, BlockPos pos) {
|
||||
super(Szar.SUPER_BEACON_SCREEN_HANDLER, syncId);
|
||||
this.inventory = inventory;
|
||||
this.propertyDelegate = propertyDelegate;
|
||||
this.pos = pos;
|
||||
|
||||
checkSize(inventory, 8);
|
||||
inventory.onOpen(playerInventory.player);
|
||||
|
||||
for (int row = 0; row < 4; row++) {
|
||||
addSlot(new EffectSlot(inventory, row * 2, 44, 18 + row * 28));
|
||||
addSlot(new FuelSlot(inventory, row * 2 + 1, 80, 18 + row * 28));
|
||||
}
|
||||
|
||||
for (int row = 0; row < 3; row++) {
|
||||
for (int col = 0; col < 9; col++) {
|
||||
addSlot(new Slot(playerInventory, col + row * 9 + 9, 8 + col * 18, 140 + row * 18));
|
||||
}
|
||||
}
|
||||
for (int col = 0; col < 9; col++) {
|
||||
addSlot(new Slot(playerInventory, col, 8 + col * 18, 198));
|
||||
}
|
||||
|
||||
addProperties(propertyDelegate);
|
||||
}
|
||||
|
||||
public int getBeaconLevel() { return propertyDelegate.get(0); }
|
||||
public boolean isRowActive(int row) { return propertyDelegate.get(1 + row) != 0; }
|
||||
public int getFuelTimer(int row) { return propertyDelegate.get(5 + row); }
|
||||
public BlockPos getPos() { return pos; }
|
||||
|
||||
@Override
|
||||
public ItemStack quickMove(PlayerEntity player, int slotIndex) {
|
||||
ItemStack newStack = ItemStack.EMPTY;
|
||||
Slot slot = this.slots.get(slotIndex);
|
||||
if (slot.hasStack()) {
|
||||
ItemStack original = slot.getStack();
|
||||
newStack = original.copy();
|
||||
if (slotIndex < 8) {
|
||||
if (!insertItem(original, 8, 44, true)) return ItemStack.EMPTY;
|
||||
} else {
|
||||
if (!insertItem(original, 0, 8, false)) return ItemStack.EMPTY;
|
||||
}
|
||||
if (original.isEmpty()) slot.setStack(ItemStack.EMPTY); else slot.markDirty();
|
||||
}
|
||||
return newStack;
|
||||
}
|
||||
|
||||
@Override public boolean canUse(PlayerEntity player) { return inventory.canPlayerUse(player); }
|
||||
|
||||
private static class EffectSlot extends Slot {
|
||||
public EffectSlot(Inventory inv, int i, int x, int y) { super(inv, i, x, y); }
|
||||
@Override public boolean canInsert(ItemStack stack) { return SuperBeaconBlockEntity.isValidEffectItem(stack); }
|
||||
@Override public int getMaxItemCount() { return 1; }
|
||||
}
|
||||
|
||||
private static class FuelSlot extends Slot {
|
||||
public FuelSlot(Inventory inv, int i, int x, int y) { super(inv, i, x, y); }
|
||||
@Override public boolean canInsert(ItemStack stack) { return SuperBeaconBlockEntity.isValidFuel(stack); }
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRe
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.world.poi.PointOfInterestHelper;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
||||
import net.fabricmc.fabric.impl.biome.TheEndBiomeData;
|
||||
import net.minecraft.advancement.Advancement;
|
||||
@@ -43,6 +44,7 @@ import net.minecraft.entity.data.TrackedDataHandlerRegistry;
|
||||
import net.minecraft.entity.decoration.painting.PaintingVariant;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.entity.passive.VillagerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.*;
|
||||
@@ -286,6 +288,24 @@ public class Szar implements ModInitializer {
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized
|
||||
.build()
|
||||
);
|
||||
public static final EntityType<OrbanEntity> OrbanEntityType =
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
new Identifier(MOD_ID, "orban"),
|
||||
FabricEntityTypeBuilder
|
||||
.create(SpawnGroup.CREATURE, OrbanEntity::new)
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F))
|
||||
.build()
|
||||
);
|
||||
public static final EntityType<MagyarEntity> MagyarEntityType =
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
new Identifier(MOD_ID, "magyar"),
|
||||
FabricEntityTypeBuilder
|
||||
.create(SpawnGroup.CREATURE, MagyarEntity::new)
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F))
|
||||
.build()
|
||||
);
|
||||
public static final EntityType<StalinEntity> StalinEntityType =
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
@@ -396,6 +416,13 @@ public class Szar implements ModInitializer {
|
||||
entries.add(Szar.ENDER_ORE_ITEM);
|
||||
entries.add(Szar.RAW_ENDER);
|
||||
entries.add(Szar.ENDER_INGOT);
|
||||
entries.add(Szar.ENDER_HELMET);
|
||||
entries.add(Szar.ENDER_CHESTPLATE);
|
||||
entries.add(Szar.ENDER_LEGGINGS);
|
||||
entries.add(Szar.ENDER_BOOTS);
|
||||
entries.add(Szar.SUPER_DIAMOND);
|
||||
entries.add(Szar.SUPER_APPLE);
|
||||
entries.add(Szar.SUPER_BEACON_ITEM);
|
||||
// blueprint stuff
|
||||
entries.add(BlueprintBlocks.BLUEPRINT);
|
||||
entries.add(BlueprintBlocks.BLUEPRINT_DOOR_ITEM);
|
||||
@@ -443,6 +470,10 @@ public class Szar implements ModInitializer {
|
||||
entries.add(Szar.COMMUNIST_SPAWNEGG);
|
||||
entries.add(Szar.ERIKA_DISC);
|
||||
entries.add(Szar.USSR_DISC);
|
||||
// politics
|
||||
entries.add(Szar.ORBAN_SPAWNEGG);
|
||||
entries.add(Szar.MAGYAR_SPAWNEGG);
|
||||
entries.add(Szar.HUN_DISC);
|
||||
// racism
|
||||
if (showRacist) {
|
||||
entries.add(Szar.CIGANYBLOCK);
|
||||
@@ -837,6 +868,14 @@ public class Szar implements ModInitializer {
|
||||
HitterEntityType,
|
||||
HitterEntity.createAttributes()
|
||||
);
|
||||
FabricDefaultAttributeRegistry.register(
|
||||
OrbanEntityType,
|
||||
OrbanEntity.createAttributes()
|
||||
);
|
||||
FabricDefaultAttributeRegistry.register(
|
||||
MagyarEntityType,
|
||||
MagyarEntity.createAttributes()
|
||||
);
|
||||
FabricDefaultAttributeRegistry.register(
|
||||
CommunistEntityType,
|
||||
CommunistEntity.createAttributes()
|
||||
@@ -905,7 +944,12 @@ public class Szar implements ModInitializer {
|
||||
1, // min group size
|
||||
2 // max group size
|
||||
);
|
||||
|
||||
BiomeModifications.addSpawn(
|
||||
BiomeSelectors.includeByKey(BiomeKeys.PLAINS, BiomeKeys.FLOWER_FOREST, BiomeKeys.FOREST),
|
||||
SpawnGroup.MONSTER,
|
||||
OrbanEntityType,
|
||||
1, 1, 1
|
||||
);
|
||||
BiomeModifications.addSpawn(
|
||||
BiomeSelectors.includeByKey(BiomeKeys.WINDSWEPT_HILLS, BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, BiomeKeys.STONY_PEAKS),
|
||||
SpawnGroup.MONSTER,
|
||||
@@ -1419,7 +1463,124 @@ public class Szar implements ModInitializer {
|
||||
}
|
||||
});
|
||||
TheEndBiomeData.addEndBiomeReplacement(BiomeKeys.END_HIGHLANDS, Szar.CHORUS_FOREST, 0.7);
|
||||
ServerLivingEntityEvents.ALLOW_DAMAGE.register((entity, source, amount) -> {
|
||||
if (!(entity instanceof PlayerEntity player)) return true;
|
||||
|
||||
// Check if wearing full Ender armor (optional — remove if you want any piece to trigger)
|
||||
boolean wearingFullSet =
|
||||
player.getInventory().getArmorStack(0).isOf(ENDER_BOOTS) &&
|
||||
player.getInventory().getArmorStack(1).isOf(ENDER_LEGGINGS) &&
|
||||
player.getInventory().getArmorStack(2).isOf(ENDER_CHESTPLATE) &&
|
||||
player.getInventory().getArmorStack(3).isOf(ENDER_HELMET);
|
||||
|
||||
if (!wearingFullSet) return true;
|
||||
|
||||
// If player would drop to <= 1 heart (2 HP)
|
||||
if (player.getHealth() - amount <= 2.0F) {
|
||||
|
||||
if (player.getWorld() instanceof ServerWorld world) {
|
||||
teleportRandomly(player, world);
|
||||
}
|
||||
|
||||
return false; // CANCEL DAMAGE
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "super_beacon"), SUPER_BEACON_BLOCK);
|
||||
Registry.register(Registries.ITEM, new Identifier(MOD_ID, "super_beacon"), SUPER_BEACON_ITEM);
|
||||
|
||||
SUPER_BEACON_BLOCK_ENTITY = Registry.register(
|
||||
Registries.BLOCK_ENTITY_TYPE,
|
||||
new Identifier(MOD_ID, "super_beacon"),
|
||||
FabricBlockEntityTypeBuilder.create(SuperBeaconBlockEntity::new, SUPER_BEACON_BLOCK).build()
|
||||
);
|
||||
|
||||
SUPER_BEACON_SCREEN_HANDLER = Registry.register(
|
||||
Registries.SCREEN_HANDLER,
|
||||
new Identifier(MOD_ID, "super_beacon"),
|
||||
new ExtendedScreenHandlerType<>(SuperBeaconScreenHandler::new)
|
||||
);
|
||||
|
||||
ServerPlayNetworking.registerGlobalReceiver(ACTIVATE_ROW_PACKET, (server, player, handler, buf, responseSender) -> {
|
||||
BlockPos pos = buf.readBlockPos();
|
||||
int row = buf.readInt();
|
||||
server.execute(() -> {
|
||||
LOGGER.info("[Szar] activate_row: pos={}, row={}", pos, row);
|
||||
if (player.getServerWorld().getBlockEntity(pos) instanceof SuperBeaconBlockEntity be) {
|
||||
if (be.canPlayerUse(player)) {
|
||||
boolean wasActive = be.isRowActive(row);
|
||||
be.toggleRow(row);
|
||||
LOGGER.info("[Szar] row {} {} -> {} (level={}, effect={}, fuel={})",
|
||||
row, wasActive, be.isRowActive(row), be.getBeaconLevel(),
|
||||
be.getStack(row * 2), be.getStack(row * 2 + 1));
|
||||
} else {
|
||||
LOGGER.warn("[Szar] player too far");
|
||||
}
|
||||
} else {
|
||||
LOGGER.warn("[Szar] no block entity at {}", pos);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
LOGGER.info("[Szar] Initialized");
|
||||
}
|
||||
public static final Block SUPER_BEACON_BLOCK = new SuperBeaconBlock(
|
||||
FabricBlockSettings.copyOf(Blocks.BEACON).luminance(15)
|
||||
);
|
||||
|
||||
public static final Item SUPER_BEACON_ITEM = new BlockItem(SUPER_BEACON_BLOCK, new FabricItemSettings());
|
||||
|
||||
public static BlockEntityType<SuperBeaconBlockEntity> SUPER_BEACON_BLOCK_ENTITY;
|
||||
public static ScreenHandlerType<SuperBeaconScreenHandler> SUPER_BEACON_SCREEN_HANDLER;
|
||||
|
||||
public static final Identifier ACTIVATE_ROW_PACKET = new Identifier(MOD_ID, "activate_row");
|
||||
|
||||
private static void teleportRandomly(PlayerEntity player, ServerWorld world) {
|
||||
Random RANDOM = new Random();
|
||||
double x = player.getX();
|
||||
double y = player.getY();
|
||||
double z = player.getZ();
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
double newX = x + (RANDOM.nextDouble() - 0.5) * 32;
|
||||
double newY = y + RANDOM.nextInt(16) - 8;
|
||||
double newZ = z + (RANDOM.nextDouble() - 0.5) * 32;
|
||||
|
||||
BlockPos pos = BlockPos.ofFloored(newX, newY, newZ);
|
||||
|
||||
if (world.isAir(pos)) {
|
||||
player.teleport(newX, newY, newZ);
|
||||
world.playSound(null, player.getBlockPos(),
|
||||
net.minecraft.sound.SoundEvents.ENTITY_ENDERMAN_TELEPORT,
|
||||
player.getSoundCategory(), 1.0F, 1.0F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static final Item ENDER_HELMET = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(Szar.MOD_ID, "ender_helmet"),
|
||||
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.HELMET, new Item.Settings())
|
||||
);
|
||||
|
||||
public static final Item ENDER_CHESTPLATE = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(Szar.MOD_ID, "ender_chestplate"),
|
||||
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Settings())
|
||||
);
|
||||
|
||||
public static final Item ENDER_LEGGINGS = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(Szar.MOD_ID, "ender_leggings"),
|
||||
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.LEGGINGS, new Item.Settings())
|
||||
);
|
||||
|
||||
public static final Item ENDER_BOOTS = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(Szar.MOD_ID, "ender_boots"),
|
||||
new ArmorItem(EnderArmorMaterial.INSTANCE, ArmorItem.Type.BOOTS, new Item.Settings())
|
||||
);
|
||||
|
||||
public static final Block TIC_TAC_TOE_BLOCK = Registry.register(
|
||||
Registries.BLOCK, new Identifier(MOD_ID, "tictactoe"),
|
||||
@@ -1551,6 +1712,28 @@ public class Szar implements ModInitializer {
|
||||
new Identifier(MOD_ID, "ender_ingot"),
|
||||
new Item(new FabricItemSettings())
|
||||
);
|
||||
public static final Item SUPER_DIAMOND = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "super_diamond"),
|
||||
new Item(new FabricItemSettings())
|
||||
);
|
||||
public static final Item SUPER_APPLE = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "super_apple"),
|
||||
new Item(new FabricItemSettings().food(
|
||||
new FoodComponent.Builder()
|
||||
.hunger(20)
|
||||
.alwaysEdible()
|
||||
.saturationModifier(20F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION,60*20, 255 ), 1F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.HEALTH_BOOST,2*60*20, 4 ), 1F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.RESISTANCE,5*60*20, 2), 1F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.FIRE_RESISTANCE,5*60*20, 2), 1F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.ABSORPTION,5*60*20, 4), 1F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.STRENGTH,5*60*20, 2), 1F)
|
||||
.build()
|
||||
).rarity(Rarity.EPIC))
|
||||
);
|
||||
// Blocks
|
||||
public static final TrackerBlock TRACKER_BLOCK = Registry.register(
|
||||
Registries.BLOCK, new Identifier(MOD_ID, "tracker"),
|
||||
@@ -2261,6 +2444,13 @@ public class Szar implements ModInitializer {
|
||||
new Identifier(MOD_ID, "baiter"),
|
||||
new MusicDiscItem(12, BAITER, new Item.Settings().maxCount(1).rarity(Rarity.RARE), 172)
|
||||
);
|
||||
public static final SoundEvent HUN_ANTHEM =
|
||||
SoundEvent.of(new Identifier(MOD_ID, "hun_anthem"));
|
||||
public static final Item HUN_DISC = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "hun_disc"),
|
||||
new MusicDiscItem(8, HUN_ANTHEM, new Item.Settings().maxCount(1).rarity(Rarity.RARE), 120)
|
||||
);
|
||||
public static final SoundEvent ERIKA =
|
||||
SoundEvent.of(new Identifier(MOD_ID, "erika"));
|
||||
public static final Item ERIKA_DISC = Registry.register(
|
||||
@@ -2319,6 +2509,26 @@ public class Szar implements ModInitializer {
|
||||
new Item.Settings()
|
||||
)
|
||||
);
|
||||
public static final Item ORBAN_SPAWNEGG = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "orban_spawn_egg"),
|
||||
new SpawnEggItem(
|
||||
OrbanEntityType,
|
||||
0xFD8100,
|
||||
0xFFFFFF,
|
||||
new Item.Settings()
|
||||
)
|
||||
);
|
||||
public static final Item MAGYAR_SPAWNEGG = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "magyar_spawn_egg"),
|
||||
new SpawnEggItem(
|
||||
MagyarEntityType,
|
||||
0x24B573,
|
||||
0xED4551,
|
||||
new Item.Settings()
|
||||
)
|
||||
);
|
||||
public static final Item HITTER_SPAWNEGG = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "hitler_spawn_egg"),
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface TeamMember {
|
||||
String getTeam(); // returns "communist" or "tsarist" (or whatever your 2nd team is)
|
||||
}
|
||||
5
src/main/java/dev/tggamesyt/szar/WarParticipant.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
public interface WarParticipant {
|
||||
String getTeam();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "szar:block/super_beacon"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,22 @@
|
||||
"block.szar.ender_ore": "Ender Ore",
|
||||
"item.szar.raw_ender": "Raw Ender",
|
||||
"item.szar.ender_ingot": "Ender Ingot",
|
||||
"item.szar.super_diamond": "Super Diamond",
|
||||
"item.szar.super_apple": "Super Apple",
|
||||
|
||||
"advancement.szar.april_game_beaten.title": "We are so back",
|
||||
"advancement.szar.april_game_beaten.description": "Beat the game on april 1st to flip the game back."
|
||||
"advancement.szar.april_game_beaten.description": "Beat the game on april 1st to flip the game back.",
|
||||
|
||||
"entity.szar.orban": "Orbán Viktor",
|
||||
"entity.szar.magyar": "Magyar Péter",
|
||||
"item.szar.hun_disc": "Music Disc",
|
||||
"item.szar.hun_disc.desc": "Kölcsey Ferenc - Hungarian Anthem",
|
||||
"item.szar.orban_spawn_egg": "Orbán Spawn Egg",
|
||||
"item.szar.magyar_spawn_egg": "Magyar Spawn Egg",
|
||||
|
||||
"item.szar.ender_chestplate": "Ender Chestplate",
|
||||
"item.szar.ender_leggings": "Ender Leggings",
|
||||
"item.szar.ender_boots": "Ender Boots",
|
||||
"item.szar.ender_helmet": "Ender Helmet",
|
||||
"block.szar.super_beacon": "Super Beacon"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"format_version": "1.21.11",
|
||||
"credit": "Made with Blockbench",
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"3": "szar:block/enchanting_table_top",
|
||||
"4": "szar:block/enchanting_table_side",
|
||||
"particle": "szar:block/glass",
|
||||
"glass": "szar:block/glass",
|
||||
"obsidian": "szar:block/obsidian",
|
||||
"beacon": "szar:block/beacon"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Glass shell",
|
||||
"from": [0, 0, 0],
|
||||
"to": [16, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 16, 16], "texture": "#glass"},
|
||||
"east": {"uv": [0, 0, 16, 16], "texture": "#glass"},
|
||||
"south": {"uv": [0, 0, 16, 16], "texture": "#glass"},
|
||||
"west": {"uv": [0, 0, 16, 16], "texture": "#glass"},
|
||||
"up": {"uv": [0, 0, 16, 16], "texture": "#glass"},
|
||||
"down": {"uv": [0, 0, 16, 16], "texture": "#glass"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Obsidian base",
|
||||
"from": [2, 0.1, 2],
|
||||
"to": [14, 3, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [2, 13, 14, 16], "texture": "#obsidian"},
|
||||
"east": {"uv": [2, 13, 14, 16], "texture": "#obsidian"},
|
||||
"south": {"uv": [2, 13, 14, 16], "texture": "#obsidian"},
|
||||
"west": {"uv": [2, 13, 14, 16], "texture": "#obsidian"},
|
||||
"up": {"uv": [2, 2, 14, 14], "texture": "#obsidian"},
|
||||
"down": {"uv": [2, 2, 14, 14], "texture": "#obsidian"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Enchanting Table",
|
||||
"from": [3, 3, 3],
|
||||
"to": [13, 11, 13],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 4, 16, 16], "texture": "#4"},
|
||||
"east": {"uv": [0, 4, 16, 16], "texture": "#4"},
|
||||
"south": {"uv": [0, 4, 16, 16], "texture": "#4"},
|
||||
"west": {"uv": [0, 4, 16, 16], "texture": "#4"},
|
||||
"up": {"uv": [0, 0, 16, 16], "texture": "#3"},
|
||||
"down": {"uv": [3, 3, 13, 13], "texture": "#3"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Inner beacon texture",
|
||||
"from": [6, 11, 6],
|
||||
"to": [10, 15, 10],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 16, 16], "texture": "#beacon"},
|
||||
"east": {"uv": [0, 0, 16, 16], "texture": "#beacon"},
|
||||
"south": {"uv": [0, 0, 16, 16], "texture": "#beacon"},
|
||||
"west": {"uv": [0, 0, 16, 16], "texture": "#beacon"},
|
||||
"up": {"uv": [0, 0, 16, 16], "texture": "#beacon"},
|
||||
"down": {"uv": [0, 0, 16, 16], "texture": "#beacon"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/ender_boots"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/ender_chestplate"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/ender_helmet"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/ender_leggings"
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/szar/models/item/hun_disc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/hun_disc"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:item/template_spawn_egg"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:item/template_spawn_egg"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/super_apple"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "szar:block/super_beacon"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/super_diamond"
|
||||
}
|
||||
}
|
||||
@@ -242,5 +242,13 @@
|
||||
"stream": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"hun_anthem": {
|
||||
"sounds": [
|
||||
{
|
||||
"name": "szar:hun_anthem",
|
||||
"stream": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/main/resources/assets/szar/sounds/hun_anthem.ogg
Normal file
BIN
src/main/resources/assets/szar/textures/block/beacon.png
Normal file
|
After Width: | Height: | Size: 588 B |
|
After Width: | Height: | Size: 273 B |
|
After Width: | Height: | Size: 199 B |
BIN
src/main/resources/assets/szar/textures/block/glass.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
src/main/resources/assets/szar/textures/block/obsidian.png
Normal file
|
After Width: | Height: | Size: 263 B |
BIN
src/main/resources/assets/szar/textures/entity/beacon_beam.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
src/main/resources/assets/szar/textures/entity/magyar.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/main/resources/assets/szar/textures/entity/orban.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/main/resources/assets/szar/textures/gui/super_beacon.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 319 B |
BIN
src/main/resources/assets/szar/textures/item/ender_boots.png
Normal file
|
After Width: | Height: | Size: 299 B |
|
After Width: | Height: | Size: 348 B |
BIN
src/main/resources/assets/szar/textures/item/ender_diamond.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
src/main/resources/assets/szar/textures/item/ender_helmet.png
Normal file
|
After Width: | Height: | Size: 311 B |
BIN
src/main/resources/assets/szar/textures/item/ender_leggings.png
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
src/main/resources/assets/szar/textures/item/hun_disc.png
Normal file
|
After Width: | Height: | Size: 320 B |
|
After Width: | Height: | Size: 268 B |
BIN
src/main/resources/assets/szar/textures/item/smol_diamond.png
Normal file
|
After Width: | Height: | Size: 628 B |
BIN
src/main/resources/assets/szar/textures/item/super_apple.png
Normal file
|
After Width: | Height: | Size: 343 B |
BIN
src/main/resources/assets/szar/textures/item/super_diamond.png
Normal file
|
After Width: | Height: | Size: 970 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 634 B |
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "szar:super_beacon"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,13 +1,5 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:gunpowder"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:iron_nugget"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"PPP",
|
||||
"BBB",
|
||||
|
||||
15
src/main/resources/data/szar/recipes/ender_boots.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"X X",
|
||||
"X X"
|
||||
],
|
||||
"key": {
|
||||
"X": {
|
||||
"item": "szar:ender_ingot"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:ender_boots"
|
||||
}
|
||||
}
|
||||
16
src/main/resources/data/szar/recipes/ender_chestplate.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"X X",
|
||||
"XXX",
|
||||
"XXX"
|
||||
],
|
||||
"key": {
|
||||
"X": {
|
||||
"item": "szar:ender_ingot"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:ender_chestplate"
|
||||
}
|
||||
}
|
||||
15
src/main/resources/data/szar/recipes/ender_helmet.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"XXX",
|
||||
"X X"
|
||||
],
|
||||
"key": {
|
||||
"X": {
|
||||
"item": "szar:ender_ingot"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:ender_helmet"
|
||||
}
|
||||
}
|
||||
16
src/main/resources/data/szar/recipes/ender_leggings.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"XXX",
|
||||
"X X",
|
||||
"X X"
|
||||
],
|
||||
"key": {
|
||||
"X": {
|
||||
"item": "szar:ender_ingot"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:ender_leggings"
|
||||
}
|
||||
}
|
||||
14
src/main/resources/data/szar/recipes/super_apple.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:apple"
|
||||
},
|
||||
{
|
||||
"item": "szar:super_diamond"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "szar:super_apple"
|
||||
}
|
||||
}
|
||||
26
src/main/resources/data/szar/recipes/super_beacon.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" E ",
|
||||
"DBD",
|
||||
"MMM"
|
||||
],
|
||||
"key": {
|
||||
"E": {
|
||||
"item": "minecraft:enchanting_table"
|
||||
},
|
||||
"D": {
|
||||
"item": "szar:super_diamond"
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:beacon"
|
||||
},
|
||||
"M": {
|
||||
"tag": "minecraft:beacon_base_blocks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:super_beacon",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
23
src/main/resources/data/szar/recipes/super_diamond.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"NEN",
|
||||
"EDE",
|
||||
"NEN"
|
||||
],
|
||||
"key": {
|
||||
"N": {
|
||||
"item": "minecraft:netherite_ingot"
|
||||
},
|
||||
"D": {
|
||||
"item": "minecraft:diamond"
|
||||
},
|
||||
"E": {
|
||||
"item": "szar:ender_ingot"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "szar:super_diamond",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
"placement": [
|
||||
{ "type": "minecraft:count", "count": 5 },
|
||||
{ "type": "minecraft:in_square" },
|
||||
{ "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" },
|
||||
{ "type": "minecraft:biome" }
|
||||
{ "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" }
|
||||
]
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
],
|
||||
"placement": {
|
||||
"type": "minecraft:random_spread",
|
||||
"spacing": 20,
|
||||
"separation": 10,
|
||||
"spacing": 10,
|
||||
"separation": 1,
|
||||
"salt": 398826349
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,6 @@ accessible method net/minecraft/client/render/entity/LivingEntityRenderer addFea
|
||||
accessible field net/minecraft/client/render/entity/EntityRenderDispatcher renderers Ljava/util/Map;
|
||||
accessible method net/minecraft/world/GameRules$BooleanRule create (ZLjava/util/function/BiConsumer;)Lnet/minecraft/world/GameRules$Type;
|
||||
accessible method net/minecraft/client/render/block/BlockModelRenderer renderQuad (Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/util/math/MatrixStack$Entry;Lnet/minecraft/client/render/model/BakedQuad;FFFFIIIII)V
|
||||
accessible field net/minecraft/client/particle/ParticleManager world Lnet/minecraft/client/world/ClientWorld;
|
||||
accessible field net/minecraft/client/particle/ParticleManager world Lnet/minecraft/client/world/ClientWorld;
|
||||
|
||||
accessible method net/minecraft/registry/tag/ItemTags of (Ljava/lang/String;)Lnet/minecraft/registry/tag/TagKey;
|
||||