Skip to content

Commit bd88eb1

Browse files
committed
fixed conflicts in merged
2 parents 5d45691 + 32c1691 commit bd88eb1

File tree

15 files changed

+359
-340
lines changed

15 files changed

+359
-340
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Metallics Arts 1.19.2-1.4.0
1+
# Metallics Arts 1.19.2-1.4.1
2+
23

34

45
## Index 📋

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77

8-
version = '1.19.2-1.4.0'
8+
version = '1.19.2-1.4.1'
99

1010
group = 'net.rudahee.metallics_arts' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1111
archivesBaseName = 'metallics_arts'

src/main/java/net/rudahee/metallics_arts/MetallicsArts.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ private void setup(final FMLCommonSetupEvent event)
127127
// some preinit code
128128
LOGGER.info("Starting Metallics Arts Setup.");
129129

130-
MetallicsPowersSetup.register(event);
131130
ModNetwork.registerPackets();
131+
MetallicsPowersSetup.register(event);
132+
132133
}
133134

134135
private void doClientStuff(final FMLClientSetupEvent event) {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package net.rudahee.metallics_arts.data.network;
2+
3+
import net.minecraft.network.FriendlyByteBuf;
4+
import net.minecraft.server.level.ServerPlayer;
5+
import net.minecraft.world.entity.player.Player;
6+
import net.minecraftforge.network.NetworkEvent;
7+
import net.rudahee.metallics_arts.modules.powers.helpers.IronAndSteelHelpers;
8+
9+
import java.util.UUID;
10+
import java.util.function.Supplier;
11+
12+
public class BannerPacket {
13+
14+
private final UUID uuid;
15+
private final int slot;
16+
17+
/**
18+
*
19+
* @param slot slot for remove
20+
* @param player the player
21+
*/
22+
public BannerPacket(int slot, Player player) {
23+
this.uuid = player.getUUID();
24+
this.slot = slot;
25+
}
26+
27+
private BannerPacket(UUID uuid, int slot) {
28+
this.slot = slot;
29+
this.uuid = uuid;
30+
}
31+
32+
public static BannerPacket decode(FriendlyByteBuf buf) {
33+
return new BannerPacket(buf.readUUID(), buf.readInt());
34+
}
35+
36+
public void encode(FriendlyByteBuf buf) {
37+
buf.writeInt(this.slot);
38+
buf.writeUUID(this.uuid);
39+
}
40+
41+
public void handle(Supplier<NetworkEvent.Context> ctx) {
42+
ctx.get().enqueueWork(() -> {
43+
ServerPlayer player = ctx.get().getSender();
44+
45+
if (player != null) {
46+
player.getInventory().removeItem(IronAndSteelHelpers.haveNuggets(player), 1);
47+
}
48+
});
49+
50+
ctx.get().setPacketHandled(true);
51+
}
52+
}

src/main/java/net/rudahee/metallics_arts/data/providers/ModLanguageProviderES.java

Lines changed: 235 additions & 293 deletions
Large diffs are not rendered by default.

src/main/java/net/rudahee/metallics_arts/data/providers/ModRecipeProvider.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ protected void buildCraftingRecipes(Consumer<FinishedRecipe> recipesConsumer) {
5656
.save(recipesConsumer, new ResourceLocation(block.getDescriptionId() + "_to_" + ModItems.ITEM_RAW_METAL.get(name).getDescriptionId()));
5757
});
5858

59+
ModItems.ITEM_RAW_METAL.forEach((name, item) -> {
60+
ShapelessRecipeBuilder.shapeless(item.asItem(), 9)
61+
.requires(ModBlock.RAW_METAL_BLOCKS.get(name))
62+
.unlockedBy("has_item", has(item))
63+
.save(recipesConsumer, new ResourceLocation(item.getDescriptionId() + "_to_" + ModBlock.RAW_METAL_BLOCKS.get(name).getDescriptionId()));
64+
});
65+
66+
5967

6068
ModItems.ITEM_GEMS_BASE.forEach((name, item) -> {
6169
ShapelessRecipeBuilder.shapeless(item.asItem(), 9)

src/main/java/net/rudahee/metallics_arts/modules/data_player/DefaultInvestedPlayerData.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.ArrayList;
99
import java.util.Arrays;
1010
import java.util.Collections;
11+
import java.util.List;
1112

1213
public class DefaultInvestedPlayerData implements IDefaultInvestedPlayerData {
1314
private final boolean[] allomantic_powers;
@@ -591,6 +592,11 @@ public void load(CompoundTag nbt) {
591592
}
592593
}
593594

595+
this.setInvested(invested_data.getBoolean("invested"));
596+
this.setMistborn(invested_data.getBoolean("mistborn"));
597+
this.setFullFeruchemic(invested_data.getBoolean("fullFeruchemic"));
598+
this.setFullInvested(invested_data.getBoolean("fullInvested"));
599+
594600
for (int i=0;i<10;i++){
595601
this.setMetalMindEquiped(i,metal_mind_equiped.getBoolean("group"+i));
596602
}
@@ -607,7 +613,6 @@ public void load(CompoundTag nbt) {
607613
} catch(Exception ex) {
608614
System.out.println("SIGUE SIENDO UNA COSTRA DE NULL EL DEATH O SPAWN POS :D");
609615
}
610-
}
611-
612616

617+
}
613618
}

src/main/java/net/rudahee/metallics_arts/modules/items/banners/Banners.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ public class Banners {
2929
RegistryObject<BannerPattern> pattern;
3030
TagKey<BannerPattern> bannerPatternTagKey;
3131
RegistryObject<BannerPatternItem> bannerPatternItem;
32-
33-
if(metal.getNameLower().contains("a_alum")) {
34-
System.out.println("az");
35-
}
3632
//Drawing patterns
3733
pattern = BANNER_PATTERN.register("a_"+metal.getNameLower()+"_1", () -> new BannerPattern(MetallicsArts.MOD_ID + "_a_" + metal.getNameLower()+"_1"));
3834
PATTERNS.put("a_"+metal.getNameLower(),pattern);

src/main/java/net/rudahee/metallics_arts/modules/items/metal_spike/MetalSpikeAbstract.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
120120
boolean hasAllomanticPower = targetData.hasAllomanticPower(MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike")));
121121
boolean hasFeruchemicPower = targetData.hasFeruchemicPower(MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike")));
122122

123-
boolean couldStealPower = Math.random()>0.90;
124-
boolean couldRemovePower = Math.random()>0.50;
123+
boolean couldStealPower = Math.random()>0.50;
124+
boolean couldRemovePower = Math.random()<0.75;
125125
boolean isAllomantic = Math.random()>0.50;
126126

127127
MetalsNBTData localMetal = MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike"));
@@ -135,19 +135,11 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
135135
if (!targetData.hasAllomanticPower(localMetal)){
136136
targetData.addAllomanticPower(localMetal);
137137
doEffects(rng, world, pos);
138-
139-
140-
141138
}
142-
143-
144139
} else if (stack.getTag().getBoolean("feruchemic_power")){
145140
if (!targetData.hasFeruchemicPower(localMetal)){
146141
targetData.addFeruchemicPower(localMetal);
147-
148142
doEffects(rng, world, pos);
149-
150-
151143
}
152144

153145
//SI EL CLAVO NO TIENE PODERES -> intenta robar
@@ -196,6 +188,8 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
196188
} else if (hasFeruchemicPower){
197189
if (Math.random()>0.50){
198190
if (Math.random()<0.75) {
191+
192+
199193
targetData.removeFeruchemicPower(localMetal);
200194

201195
target.addEffect(new MobEffectInstance(MobEffects.GLOWING, 40, 1, true, true, false));

src/main/java/net/rudahee/metallics_arts/modules/powers/PowersEventHandler.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import net.minecraftforge.event.entity.player.PlayerSetSpawnEvent;
2727
import net.minecraftforge.eventbus.api.SubscribeEvent;
2828
import net.minecraftforge.fml.common.Mod;
29+
import net.rudahee.metallics_arts.modules.data_player.DefaultInvestedPlayerData;
2930
import net.rudahee.metallics_arts.modules.data_player.InvestedCapability;
3031
import net.rudahee.metallics_arts.modules.powers.helpers.*;
3132
import net.rudahee.metallics_arts.setup.enums.extras.MetalsNBTData;
@@ -79,12 +80,14 @@ public static void onJoinWorld(final PlayerEvent.PlayerLoggedInEvent event) {
7980
data.setSpawnDimension(dim);
8081
}
8182
if (data.getDeathDimension() == null) {
82-
int[] pos = {player.level.getLevelData().getXSpawn(),player.level.getLevelData().getYSpawn(),player.level.getLevelData().getZSpawn()};
83+
int[] pos = {player.level.getLevelData().getXSpawn(), player.level.getLevelData().getYSpawn(),player.level.getLevelData().getZSpawn()};
8384
String dim = player.level.dimension().location().toString();
8485
data.setDeathPos(pos);
8586
data.setDeathDimension(dim);
8687
}
87-
if (data.getAllomanticPowerCount() + data.getFeruchemicPowerCount() == 0) {
88+
89+
//Se necesita hacer que cargue la date del player antes de ejecutar el onjoin world, o no funciona bien
90+
if ((data.getAllomanticPowerCount() + data.getFeruchemicPowerCount() == 0) && !data.isInvested()) {
8891
List<MetalsNBTData> metals = Arrays.asList(MetalsNBTData.values());
8992
Collections.shuffle(metals);
9093
List<Integer> typeOfPower = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2); // Leras footjob
@@ -103,11 +106,12 @@ public static void onJoinWorld(final PlayerEvent.PlayerLoggedInEvent event) {
103106
Collections.shuffle(metals);
104107
data.addFeruchemicPower(metals.get(0));
105108
}
106-
}
107109
data.setInvested(true);
110+
}
111+
108112
});
109113
//Sync cap to client
110-
ModNetwork.sync(event.getEntity());
114+
ModNetwork.sync(player);
111115
}
112116
}
113117
}
@@ -153,7 +157,6 @@ public static void onLivingDeath(final LivingDeathEvent event) {
153157
@SubscribeEvent
154158
public static void onRespawn(final PlayerEvent.PlayerRespawnEvent event) {
155159
if (!event.getEntity().getCommandSenderWorld().isClientSide()) {
156-
157160
ModNetwork.sync(event.getEntity());
158161
}
159162
}

0 commit comments

Comments
 (0)