property cleanup
This commit is contained in:
parent
734279ad95
commit
a836d7a2a5
99 changed files with 564 additions and 731 deletions
|
@ -161,7 +161,7 @@ import common.packet.HPacketHandshake;
|
|||
import common.packet.CPacketAction.Action;
|
||||
import common.potion.Potion;
|
||||
import common.potion.PotionEffect;
|
||||
import common.properties.IProperty;
|
||||
import common.properties.Property;
|
||||
import common.sound.EventType;
|
||||
import common.sound.PositionedSound;
|
||||
import common.util.BlockPos;
|
||||
|
@ -1929,7 +1929,7 @@ public class Client implements IThreadListener {
|
|||
"Schaue auf: " + BlockRegistry.getNameFromBlock(block.getBlock()) + "\n" +
|
||||
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
|
||||
);
|
||||
for(Entry<IProperty, Comparable> entry : block.getProperties().entrySet()) {
|
||||
for(Entry<Property, Comparable> entry : block.getProperties().entrySet()) {
|
||||
str.append("\n" + entry.getKey().getName() + ": " + entry.getValue().toString());
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import common.collect.Maps;
|
|||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.FluidRegistry;
|
||||
import common.properties.IProperty;
|
||||
import common.properties.Property;
|
||||
import common.util.IRegistry;
|
||||
import common.world.State;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ModelManager
|
|||
// Log.info("Builtin: " + BlockRegistry.getNameFromBlock(block));
|
||||
}
|
||||
else {
|
||||
IProperty<?>[] ignored = block.getIgnoredProperties();
|
||||
Property<?>[] ignored = block.getIgnoredProperties();
|
||||
if(ignored != null)
|
||||
this.mappers.put(block, new MultiStateMap.Builder().ignore(ignored).build());
|
||||
}
|
||||
|
|
|
@ -7,16 +7,16 @@ import java.util.Map;
|
|||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.init.BlockRegistry;
|
||||
import common.properties.IProperty;
|
||||
import common.properties.Property;
|
||||
import common.world.State;
|
||||
|
||||
public class MultiStateMap extends StateMap
|
||||
{
|
||||
private final IProperty<?> name;
|
||||
private final Property<?> name;
|
||||
private final String suffix;
|
||||
private final List < IProperty<? >> ignored;
|
||||
private final List < Property<? >> ignored;
|
||||
|
||||
private MultiStateMap(IProperty<?> name, String suffix, List < IProperty<? >> ignored)
|
||||
private MultiStateMap(Property<?> name, String suffix, List < Property<? >> ignored)
|
||||
{
|
||||
this.name = name;
|
||||
this.suffix = suffix;
|
||||
|
@ -25,7 +25,7 @@ public class MultiStateMap extends StateMap
|
|||
|
||||
protected String getResourceLocation(State state)
|
||||
{
|
||||
Map<IProperty, Comparable> map = Maps.<IProperty, Comparable>newLinkedHashMap(state.getProperties());
|
||||
Map<Property, Comparable> map = Maps.<Property, Comparable>newLinkedHashMap(state.getProperties());
|
||||
String s;
|
||||
|
||||
if (this.name == null)
|
||||
|
@ -34,7 +34,7 @@ public class MultiStateMap extends StateMap
|
|||
}
|
||||
else
|
||||
{
|
||||
s = ((IProperty)this.name).getName((Comparable)map.remove(this.name));
|
||||
s = ((Property)this.name).getName((Comparable)map.remove(this.name));
|
||||
}
|
||||
|
||||
if (this.suffix != null)
|
||||
|
@ -42,7 +42,7 @@ public class MultiStateMap extends StateMap
|
|||
s = s + this.suffix;
|
||||
}
|
||||
|
||||
for (IProperty<?> iproperty : this.ignored)
|
||||
for (Property<?> iproperty : this.ignored)
|
||||
{
|
||||
map.remove(iproperty);
|
||||
}
|
||||
|
@ -52,11 +52,11 @@ public class MultiStateMap extends StateMap
|
|||
|
||||
public static class Builder
|
||||
{
|
||||
private IProperty<?> name;
|
||||
private Property<?> name;
|
||||
private String suffix;
|
||||
private final List < IProperty<? >> ignored = Lists. < IProperty<? >> newArrayList();
|
||||
private final List < Property<? >> ignored = Lists. < Property<? >> newArrayList();
|
||||
|
||||
public MultiStateMap.Builder withName(IProperty<?> builderPropertyIn)
|
||||
public MultiStateMap.Builder withName(Property<?> builderPropertyIn)
|
||||
{
|
||||
this.name = builderPropertyIn;
|
||||
return this;
|
||||
|
@ -68,7 +68,7 @@ public class MultiStateMap extends StateMap
|
|||
return this;
|
||||
}
|
||||
|
||||
public MultiStateMap.Builder ignore(IProperty<?>... p_178442_1_)
|
||||
public MultiStateMap.Builder ignore(Property<?>... p_178442_1_)
|
||||
{
|
||||
Collections.addAll(this.ignored, p_178442_1_);
|
||||
return this;
|
||||
|
|
|
@ -5,25 +5,25 @@ import java.util.Map.Entry;
|
|||
|
||||
import common.block.Block;
|
||||
import common.collect.Maps;
|
||||
import common.properties.IProperty;
|
||||
import common.properties.Property;
|
||||
import common.world.State;
|
||||
|
||||
public abstract class StateMap
|
||||
{
|
||||
protected Map<State, String> mapStateModelLocations = Maps.<State, String>newLinkedHashMap();
|
||||
|
||||
public String getPropertyString(Map<IProperty, Comparable> p_178131_1_)
|
||||
public String getPropertyString(Map<Property, Comparable> p_178131_1_)
|
||||
{
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
|
||||
for (Entry<IProperty, Comparable> entry : p_178131_1_.entrySet())
|
||||
for (Entry<Property, Comparable> entry : p_178131_1_.entrySet())
|
||||
{
|
||||
if (stringbuilder.length() != 0)
|
||||
{
|
||||
stringbuilder.append(",");
|
||||
}
|
||||
|
||||
IProperty iproperty = (IProperty)entry.getKey();
|
||||
Property iproperty = (Property)entry.getKey();
|
||||
Comparable comparable = (Comparable)entry.getValue();
|
||||
stringbuilder.append(iproperty.getName());
|
||||
stringbuilder.append("=");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue